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

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

Issue 497273002: Switch to using WebSettings only for accessibilityEnabled and inlineTextBoxAccess (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 22 matching lines...) Expand all
33 namespace content { 33 namespace content {
34 34
35 RendererAccessibilityComplete::RendererAccessibilityComplete( 35 RendererAccessibilityComplete::RendererAccessibilityComplete(
36 RenderFrameImpl* render_frame) 36 RenderFrameImpl* render_frame)
37 : RendererAccessibility(render_frame), 37 : RendererAccessibility(render_frame),
38 weak_factory_(this), 38 weak_factory_(this),
39 tree_source_(render_frame), 39 tree_source_(render_frame),
40 serializer_(&tree_source_), 40 serializer_(&tree_source_),
41 last_scroll_offset_(gfx::Size()), 41 last_scroll_offset_(gfx::Size()),
42 ack_pending_(false) { 42 ack_pending_(false) {
43 WebAXObject::enableAccessibility();
44 WebView* web_view = render_frame_->GetRenderView()->GetWebView(); 43 WebView* web_view = render_frame_->GetRenderView()->GetWebView();
45 WebSettings* settings = web_view->settings(); 44 WebSettings* settings = web_view->settings();
46 settings->setAccessibilityEnabled(true); 45 settings->setAccessibilityEnabled(true);
47 46
48 #if !defined(OS_ANDROID) 47 #if !defined(OS_ANDROID)
49 // Skip inline text boxes on Android - since there are no native Android 48 // Skip inline text boxes on Android - since there are no native Android
50 // APIs that compute the bounds of a range of text, it's a waste to 49 // APIs that compute the bounds of a range of text, it's a waste to
51 // include these in the AX tree. 50 // include these in the AX tree.
52 WebAXObject::enableInlineTextBoxAccessibility();
53 settings->setInlineTextBoxAccessibilityEnabled(true); 51 settings->setInlineTextBoxAccessibilityEnabled(true);
54 #endif 52 #endif
55 53
56 const WebDocument& document = GetMainDocument(); 54 const WebDocument& document = GetMainDocument();
57 if (!document.isNull()) { 55 if (!document.isNull()) {
58 // It's possible that the webview has already loaded a webpage without 56 // It's possible that the webview has already loaded a webpage without
59 // accessibility being enabled. Initialize the browser's cached 57 // accessibility being enabled. Initialize the browser's cached
60 // accessibility tree by sending it a notification. 58 // accessibility tree by sending it a notification.
61 HandleAXEvent(document.accessibilityObject(), 59 HandleAXEvent(document.accessibilityObject(),
62 ui::AX_EVENT_LAYOUT_COMPLETE); 60 ui::AX_EVENT_LAYOUT_COMPLETE);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement(); 409 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement();
412 else 410 else
413 obj.setFocused(true); 411 obj.setFocused(true);
414 } 412 }
415 413
416 void RendererAccessibilityComplete::OnFatalError() { 414 void RendererAccessibilityComplete::OnFatalError() {
417 CHECK(false) << "Invalid accessibility tree."; 415 CHECK(false) << "Invalid accessibility tree.";
418 } 416 }
419 417
420 } // namespace content 418 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698