Commit 62ea4420 authored by aboxhall's avatar aboxhall Committed by Commit bot

Use both APIs for enabling accessibility

https://codereview.chromium.org/491483006

BUG=406622

Review URL: https://codereview.chromium.org/497263002

Cr-Commit-Position: refs/heads/master@{#292490}
parent 2252c70c
......@@ -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();
......
......@@ -10,6 +10,7 @@
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebSettings.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace content {
......@@ -147,7 +148,11 @@ void AccessibilityController::Reset() {
void AccessibilityController::Install(blink::WebFrame* frame) {
blink::WebAXObject::enableAccessibility();
frame->view()->settings()->setAccessibilityEnabled(true);
blink::WebAXObject::enableInlineTextBoxAccessibility();
frame->view()->settings()->setInlineTextBoxAccessibilityEnabled(true);
AccessibilityControllerBindings::Install(weak_factory_.GetWeakPtr(), frame);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment