Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: content/shell/renderer/test_runner/accessibility_controller.h

Issue 172263002: Move WebAXObjectProxy and AccessibleController from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebasing) Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
7
8 #include <vector>
9
10 #include "base/memory/weak_ptr.h"
11 #include "content/shell/renderer/test_runner/web_ax_object_proxy.h"
12 #include "third_party/WebKit/public/web/WebAXObject.h"
13 #include "v8/include/v8.h"
14
15 namespace blink {
16 class WebFrame;
17 class WebString;
18 class WebView;
19 }
20
21 namespace WebTestRunner {
22 class WebTestDelegate;
23 }
24
25 namespace content {
26
27 class AccessibilityController :
28 public base::SupportsWeakPtr<AccessibilityController> {
29 public:
30 AccessibilityController();
31 ~AccessibilityController();
32
33 void Reset();
34 void Install(blink::WebFrame* frame);
35 void SetFocusedElement(const blink::WebAXObject&);
36 bool ShouldLogAccessibilityEvents();
37 void NotificationReceived(const blink::WebAXObject& target,
38 const std::string& notification_name);
39
40 void SetDelegate(WebTestRunner::WebTestDelegate* delegate);
41 void SetWebView(blink::WebView* web_view);
42
43 private:
44 friend class AccessibilityControllerBindings;
45
46 // Bound methods and properties
47 void LogAccessibilityEvents();
48 void SetNotificationListener(v8::Handle<v8::Function> callback);
49 void UnsetNotificationListener();
50 v8::Handle<v8::Object> FocusedElement();
51 v8::Handle<v8::Object> RootElement();
52 v8::Handle<v8::Object> AccessibleElementById(const std::string& id);
53
54 v8::Handle<v8::Object> FindAccessibleElementByIdRecursive(
55 const blink::WebAXObject&, const blink::WebString& id);
56
57 // If true, will log all accessibility notifications.
58 bool log_accessibility_events_;
59
60 blink::WebAXObject focused_element_;
61 blink::WebAXObject root_element_;
62
63 WebAXObjectProxyList elements_;
64
65 v8::Persistent<v8::Function> notification_callback_;
66
67 WebTestRunner::WebTestDelegate* delegate_;
68 blink::WebView* web_view_;
69
70 base::WeakPtrFactory<AccessibilityController> weak_factory_;
71
72 DISALLOW_COPY_AND_ASSIGN(AccessibilityController);
73 };
74
75 } // namespace content
76
77 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/WebTestProxy.cpp ('k') | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698