Forward accessibility events to the automation extension process.
[chromium-blink-merge.git] / chrome / renderer / extensions / automation_internal_custom_bindings.h
blob1bc8a795daa7a631cf7bf71cffbc3134e78c2fb9
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
3 // found in the LICENSE file.
5 #ifndef CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_
6 #define CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_
8 #include "base/compiler_specific.h"
9 #include "extensions/renderer/object_backed_native_handler.h"
10 #include "ipc/ipc_message.h"
11 #include "ui/accessibility/ax_tree.h"
12 #include "v8/include/v8.h"
14 struct ExtensionMsg_AccessibilityEventParams;
16 namespace extensions {
18 class AutomationMessageFilter;
20 // The native component of custom bindings for the chrome.automationInternal
21 // API.
22 class AutomationInternalCustomBindings : public ObjectBackedNativeHandler {
23 public:
24 explicit AutomationInternalCustomBindings(ScriptContext* context);
26 ~AutomationInternalCustomBindings() override;
28 bool OnMessageReceived(const IPC::Message& message);
30 private:
31 // Returns whether this extension has the "interact" permission set (either
32 // explicitly or implicitly after manifest parsing).
33 void IsInteractPermitted(const v8::FunctionCallbackInfo<v8::Value>& args);
35 // Returns an object with bindings that will be added to the
36 // chrome.automation namespace.
37 void GetSchemaAdditions(const v8::FunctionCallbackInfo<v8::Value>& args);
39 // Get the routing ID for the extension.
40 void GetRoutingID(const v8::FunctionCallbackInfo<v8::Value>& args);
42 // Handle accessibility events from the browser process.
43 void OnAccessibilityEvent(
44 const ExtensionMsg_AccessibilityEventParams& params);
46 scoped_refptr<AutomationMessageFilter> message_filter_;
48 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings);
51 } // namespace extensions
53 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_