OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "extensions/renderer/object_backed_native_handler.h" | 9 #include "extensions/renderer/object_backed_native_handler.h" |
| 10 #include "ipc/ipc_message.h" |
| 11 #include "ui/accessibility/ax_tree.h" |
10 #include "v8/include/v8.h" | 12 #include "v8/include/v8.h" |
11 | 13 |
| 14 struct ExtensionMsg_AccessibilityEventParams; |
| 15 |
12 namespace extensions { | 16 namespace extensions { |
13 | 17 |
| 18 class AutomationMessageFilter; |
| 19 |
14 // The native component of custom bindings for the chrome.automationInternal | 20 // The native component of custom bindings for the chrome.automationInternal |
15 // API. | 21 // API. |
16 class AutomationInternalCustomBindings : public ObjectBackedNativeHandler { | 22 class AutomationInternalCustomBindings : public ObjectBackedNativeHandler { |
17 public: | 23 public: |
18 explicit AutomationInternalCustomBindings(ScriptContext* context); | 24 explicit AutomationInternalCustomBindings(ScriptContext* context); |
19 | 25 |
20 ~AutomationInternalCustomBindings() override; | 26 ~AutomationInternalCustomBindings() override; |
21 | 27 |
| 28 bool OnMessageReceived(const IPC::Message& message); |
| 29 |
22 private: | 30 private: |
23 // Returns whether this extension has the "interact" permission set (either | 31 // Returns whether this extension has the "interact" permission set (either |
24 // explicitly or implicitly after manifest parsing). | 32 // explicitly or implicitly after manifest parsing). |
25 void IsInteractPermitted(const v8::FunctionCallbackInfo<v8::Value>& args); | 33 void IsInteractPermitted(const v8::FunctionCallbackInfo<v8::Value>& args); |
26 | 34 |
27 // Returns an object with bindings that will be added to the | 35 // Returns an object with bindings that will be added to the |
28 // chrome.automation namespace. | 36 // chrome.automation namespace. |
29 void GetSchemaAdditions(const v8::FunctionCallbackInfo<v8::Value>& args); | 37 void GetSchemaAdditions(const v8::FunctionCallbackInfo<v8::Value>& args); |
30 | 38 |
| 39 // Get the routing ID for the extension. |
| 40 void GetRoutingID(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 41 |
| 42 // Handle accessibility events from the browser process. |
| 43 void OnAccessibilityEvent( |
| 44 const ExtensionMsg_AccessibilityEventParams& params); |
| 45 |
| 46 scoped_refptr<AutomationMessageFilter> message_filter_; |
| 47 |
31 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); | 48 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); |
32 }; | 49 }; |
33 | 50 |
34 } // namespace extensions | 51 } // namespace extensions |
35 | 52 |
36 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 53 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
OLD | NEW |