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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility_complete.cc

Issue 602133002: Disable accessibility when VoiceOver is turned off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 #include "content/renderer/accessibility/renderer_accessibility_complete.h" 5 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (document.isNull()) 91 if (document.isNull())
92 return; 92 return;
93 93
94 if (node.isNull()) { 94 if (node.isNull()) {
95 // When focus is cleared, implicitly focus the document. 95 // When focus is cleared, implicitly focus the document.
96 // TODO(dmazzoni): Make Blink send this notification instead. 96 // TODO(dmazzoni): Make Blink send this notification instead.
97 HandleAXEvent(document.accessibilityObject(), ui::AX_EVENT_BLUR); 97 HandleAXEvent(document.accessibilityObject(), ui::AX_EVENT_BLUR);
98 } 98 }
99 } 99 }
100 100
101 void RendererAccessibilityComplete::DisableAccessibility() {
102 RenderView* render_view = render_frame_->GetRenderView();
103 if (!render_view)
104 return;
105
106 WebView* web_view = render_view->GetWebView();
107 if (!web_view)
108 return;
109
110 WebSettings* settings = web_view->settings();
111 if (!settings)
112 return;
113
114 settings->setAccessibilityEnabled(false);
115 }
116
101 void RendererAccessibilityComplete::HandleWebAccessibilityEvent( 117 void RendererAccessibilityComplete::HandleWebAccessibilityEvent(
102 const blink::WebAXObject& obj, blink::WebAXEvent event) { 118 const blink::WebAXObject& obj, blink::WebAXEvent event) {
103 HandleAXEvent(obj, AXEventFromBlink(event)); 119 HandleAXEvent(obj, AXEventFromBlink(event));
104 } 120 }
105 121
106 void RendererAccessibilityComplete::HandleAXEvent( 122 void RendererAccessibilityComplete::HandleAXEvent(
107 const blink::WebAXObject& obj, ui::AXEvent event) { 123 const blink::WebAXObject& obj, ui::AXEvent event) {
108 const WebDocument& document = GetMainDocument(); 124 const WebDocument& document = GetMainDocument();
109 if (document.isNull()) 125 if (document.isNull())
110 return; 126 return;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement(); 432 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement();
417 else 433 else
418 obj.setFocused(true); 434 obj.setFocused(true);
419 } 435 }
420 436
421 void RendererAccessibilityComplete::OnFatalError() { 437 void RendererAccessibilityComplete::OnFatalError() {
422 CHECK(false) << "Invalid accessibility tree."; 438 CHECK(false) << "Invalid accessibility tree.";
423 } 439 }
424 440
425 } // namespace content 441 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/accessibility/renderer_accessibility_complete.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698