OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ | 5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ |
6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ | 6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ |
7 | 7 |
8 #include "content/common/accessibility_messages.h" | 8 #include "content/common/accessibility_messages.h" |
9 #include "content/public/renderer/render_view_observer.h" | 9 #include "content/public/renderer/render_view_observer.h" |
10 #include "third_party/WebKit/public/web/WebAXObject.h" | 10 #include "third_party/WebKit/public/web/WebAXObject.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 class WebDocument; | 13 class WebDocument; |
14 }; | 14 }; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class RenderViewImpl; | 17 class RenderFrameImpl; |
18 | 18 |
19 enum RendererAccessibilityType { | 19 enum RendererAccessibilityType { |
20 // Turns on Blink accessibility and provides a full accessibility | 20 // Turns on Blink accessibility and provides a full accessibility |
21 // implementation for when assistive technology is running. | 21 // implementation for when assistive technology is running. |
22 RendererAccessibilityTypeComplete, | 22 RendererAccessibilityTypeComplete, |
23 | 23 |
24 // Does not turn on Blink accessibility. Only sends a minimal accessible tree | 24 // Does not turn on Blink accessibility. Only sends a minimal accessible tree |
25 // to the browser whenever focus changes. This mode is currently used to | 25 // to the browser whenever focus changes. This mode is currently used to |
26 // support opening the on-screen keyboard in response to touch events on | 26 // support opening the on-screen keyboard in response to touch events on |
27 // Windows 8 in Metro mode. | 27 // Windows 8 in Metro mode. |
(...skipping 25 matching lines...) Expand all Loading... |
53 // assistive technology is running. | 53 // assistive technology is running. |
54 // | 54 // |
55 // RendererAccessibilityFocusOnly - does not turn on Blink | 55 // RendererAccessibilityFocusOnly - does not turn on Blink |
56 // accessibility. Only sends a minimal accessible tree to the | 56 // accessibility. Only sends a minimal accessible tree to the |
57 // browser whenever focus changes. This mode is currently used | 57 // browser whenever focus changes. This mode is currently used |
58 // to support opening the on-screen keyboard in response to | 58 // to support opening the on-screen keyboard in response to |
59 // touch events on Windows 8 in Metro mode. | 59 // touch events on Windows 8 in Metro mode. |
60 // | 60 // |
61 class CONTENT_EXPORT RendererAccessibility : public RenderViewObserver { | 61 class CONTENT_EXPORT RendererAccessibility : public RenderViewObserver { |
62 public: | 62 public: |
63 explicit RendererAccessibility(RenderViewImpl* render_view); | 63 explicit RendererAccessibility(RenderFrameImpl* render_frame); |
64 virtual ~RendererAccessibility(); | 64 virtual ~RendererAccessibility(); |
65 | 65 |
66 // Called when an accessibility notification occurs in Blink. | 66 // Called when an accessibility notification occurs in Blink. |
67 virtual void HandleWebAccessibilityEvent( | 67 virtual void HandleWebAccessibilityEvent( |
68 const blink::WebAXObject& obj, blink::WebAXEvent event) = 0; | 68 const blink::WebAXObject& obj, blink::WebAXEvent event) = 0; |
69 | 69 |
70 // Gets the type of this RendererAccessibility object. Primarily intended for | 70 // Gets the type of this RendererAccessibility object. Primarily intended for |
71 // testing. | 71 // testing. |
72 virtual RendererAccessibilityType GetType() = 0; | 72 virtual RendererAccessibilityType GetType() = 0; |
73 | 73 |
74 protected: | 74 protected: |
75 // Returns the main top-level document for this page, or NULL if there's | 75 // Returns the main top-level document for this page, or NULL if there's |
76 // no view or frame. | 76 // no view or frame. |
77 blink::WebDocument GetMainDocument(); | 77 blink::WebDocument GetMainDocument(); |
78 | 78 |
79 #ifndef NDEBUG | 79 #ifndef NDEBUG |
80 const std::string AccessibilityEventToString(ui::AXEvent event); | 80 const std::string AccessibilityEventToString(ui::AXEvent event); |
81 #endif | 81 #endif |
82 | 82 |
83 // The RenderViewImpl that owns us. | 83 // The RenderFrameImpl that owns us. |
84 RenderViewImpl* render_view_; | 84 RenderFrameImpl* render_frame_; |
85 | 85 |
86 // True if verbose logging of accessibility events is on. | 86 // True if verbose logging of accessibility events is on. |
87 bool logging_; | 87 bool logging_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(RendererAccessibility); | 89 DISALLOW_COPY_AND_ASSIGN(RendererAccessibility); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace content | 92 } // namespace content |
93 | 93 |
94 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ | 94 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ |
OLD | NEW |