1// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INPUT_API_H_
6#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INPUT_API_H_
7#pragma once
8
9#include "chrome/browser/extensions/extension_function.h"
10
11namespace views {
12  class RootView;
13}  // namespace views
14
15// Base class for input APIs.
16class InputFunction : public AsyncExtensionFunction {
17 public:
18  virtual void Run();
19  virtual bool RunImpl() = 0;
20};
21
22// Note that this experimental API is currently only available for
23// TOOLKIT_VIEWS (see chrome/chrome_browser.gypi).
24//
25// We may eventually support other platforms by adding the necessary
26// synthetic event distribution code to this Function.
27class SendKeyboardEventInputFunction : public InputFunction {
28 public:
29  virtual bool RunImpl();
30  DECLARE_EXTENSION_FUNCTION_NAME("experimental.input.sendKeyboardEvent");
31
32 private:
33  views::RootView* GetRootView();
34};
35
36#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_INPUT_API_H_
37