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

Unified Diff: content/renderer/accessibility/renderer_accessibility_complete.cc

Issue 497263002: Use both APIs (WebAXObject and WebSettings) for enabling accessibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No setAccessibility methods on WebFrame Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/accessibility/renderer_accessibility_complete.cc
diff --git a/content/renderer/accessibility/renderer_accessibility_complete.cc b/content/renderer/accessibility/renderer_accessibility_complete.cc
index be1cde8418753012d1ee65d38d1c5dc4a35c93ae..11b5cbfb2b345637b0657ca13ccb4e7d90bf4791 100644
--- a/content/renderer/accessibility/renderer_accessibility_complete.cc
+++ b/content/renderer/accessibility/renderer_accessibility_complete.cc
@@ -13,17 +13,21 @@
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/web/WebAXObject.h"
#include "third_party/WebKit/public/web/WebDocument.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebInputElement.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebNode.h"
+#include "third_party/WebKit/public/web/WebSettings.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "ui/accessibility/ax_tree.h"
using blink::WebAXObject;
using blink::WebDocument;
+using blink::WebFrame;
using blink::WebNode;
using blink::WebPoint;
using blink::WebRect;
+using blink::WebSettings;
using blink::WebView;
namespace content {
@@ -37,12 +41,16 @@ RendererAccessibilityComplete::RendererAccessibilityComplete(
last_scroll_offset_(gfx::Size()),
ack_pending_(false) {
WebAXObject::enableAccessibility();
+ WebView* web_view = render_frame_->GetRenderView()->GetWebView();
+ WebSettings* settings = web_view->settings();
+ settings->setAccessibilityEnabled(true);
#if !defined(OS_ANDROID)
// Skip inline text boxes on Android - since there are no native Android
// APIs that compute the bounds of a range of text, it's a waste to
// include these in the AX tree.
WebAXObject::enableInlineTextBoxAccessibility();
+ settings->setInlineTextBoxAccessibilityEnabled(true);
#endif
const WebDocument& document = GetMainDocument();
« 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