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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility.h

Issue 651593002: Remove RendererAccessibilityFocusOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert patch set #4 Created 6 years, 2 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
OLDNEW
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_frame_observer.h" 9 #include "content/public/renderer/render_frame_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 RenderFrameImpl; 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
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
26 // support opening the on-screen keyboard in response to touch events on
27 // Windows 8 in Metro mode.
28 RendererAccessibilityTypeFocusOnly
29 }; 23 };
30 24
31 // The browser process implement native accessibility APIs, allowing 25 // The browser process implement native accessibility APIs, allowing
32 // assistive technology (e.g., screen readers, magnifiers) to access and 26 // assistive technology (e.g., screen readers, magnifiers) to access and
33 // control the web contents with high-level APIs. These APIs are also used 27 // control the web contents with high-level APIs. These APIs are also used
34 // by automation tools, and Windows 8 uses them to determine when the 28 // by automation tools, and Windows 8 uses them to determine when the
35 // on-screen keyboard should be shown. 29 // on-screen keyboard should be shown.
36 // 30 //
37 // An instance of this class (or rather, a subclass) belongs to RenderFrameImpl. 31 // An instance of this class (or rather, a subclass) belongs to RenderFrameImpl.
38 // Accessibility is initialized based on the AccessibilityMode of 32 // Accessibility is initialized based on the AccessibilityMode of
39 // RenderFrameImpl; it lazily starts as Off or EditableTextOnly depending on 33 // RenderFrameImpl; it lazily starts as Off or EditableTextOnly depending on
40 // the operating system, and switches to Complete if assistive technology is 34 // the operating system, and switches to Complete if assistive technology is
41 // detected or a flag is set. 35 // detected or a flag is set.
42 // 36 //
43 // A tree of accessible objects is built here and sent to the browser process; 37 // A tree of accessible objects is built here and sent to the browser process;
44 // the browser process maintains this as a tree of platform-native 38 // the browser process maintains this as a tree of platform-native
45 // accessible objects that can be used to respond to accessibility requests 39 // accessible objects that can be used to respond to accessibility requests
46 // from other processes. 40 // from other processes.
47 // 41 //
48 // This base class just contains common code and will not do anything by itself. 42 // This base class just contains common code and will not do anything by itself.
49 // The two subclasses are: 43 // The subclass is:
50 // 44 //
51 // RendererAccessibilityComplete - turns on Blink accessibility and 45 // RendererAccessibilityComplete - turns on Blink accessibility and
52 // provides a full accessibility implementation for when 46 // provides a full accessibility implementation for when
53 // assistive technology is running. 47 // assistive technology is running.
54 // 48 //
55 // RendererAccessibilityFocusOnly - does not turn on Blink
56 // accessibility. Only sends a minimal accessible tree to the
57 // browser whenever focus changes. This mode is currently used
58 // to support opening the on-screen keyboard in response to
59 // touch events on Windows 8 in Metro mode.
60 //
61 class CONTENT_EXPORT RendererAccessibility : public RenderFrameObserver { 49 class CONTENT_EXPORT RendererAccessibility : public RenderFrameObserver {
62 public: 50 public:
63 explicit RendererAccessibility(RenderFrameImpl* render_frame); 51 explicit RendererAccessibility(RenderFrameImpl* render_frame);
64 virtual ~RendererAccessibility(); 52 virtual ~RendererAccessibility();
65 53
66 // Called when an accessibility notification occurs in Blink. 54 // Called when an accessibility notification occurs in Blink.
67 virtual void HandleWebAccessibilityEvent( 55 virtual void HandleWebAccessibilityEvent(
68 const blink::WebAXObject& obj, blink::WebAXEvent event) = 0; 56 const blink::WebAXObject& obj, blink::WebAXEvent event) = 0;
69 virtual void FocusedNodeChanged(const blink::WebNode& node) = 0; 57 virtual void FocusedNodeChanged(const blink::WebNode& node) = 0;
70 58
71 // Gets the type of this RendererAccessibility object. Primarily intended for 59 // Gets the type of this RendererAccessibility object. Primarily intended for
72 // testing. 60 // testing.
73 virtual RendererAccessibilityType GetType() = 0; 61 virtual RendererAccessibilityType GetType() = 0;
74 62
75 protected: 63 protected:
76 // Returns the main top-level document for this page, or NULL if there's 64 // Returns the main top-level document for this page, or NULL if there's
77 // no view or frame. 65 // no view or frame.
78 blink::WebDocument GetMainDocument(); 66 blink::WebDocument GetMainDocument();
79 67
80 // The RenderFrameImpl that owns us. 68 // The RenderFrameImpl that owns us.
81 RenderFrameImpl* render_frame_; 69 RenderFrameImpl* render_frame_;
82 70
83 DISALLOW_COPY_AND_ASSIGN(RendererAccessibility); 71 DISALLOW_COPY_AND_ASSIGN(RendererAccessibility);
84 }; 72 };
85 73
86 } // namespace content 74 } // namespace content
87 75
88 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_ 76 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_H_
OLDNEW
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/accessibility/renderer_accessibility_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698