| Index: content/browser/accessibility/browser_accessibility_manager.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
|
| index 498d8533693a800cf73171e4dc17f1ea301c5d87..5ce98f730f290d013bd56830e9f887fd4dd0feb2 100644
|
| --- a/content/browser/accessibility/browser_accessibility_manager.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_manager.cc
|
| @@ -17,7 +17,8 @@ BrowserAccessibility* BrowserAccessibilityFactory::Create() {
|
|
|
| #if !defined(OS_MACOSX) && \
|
| !defined(OS_WIN) && \
|
| - !defined(TOOLKIT_GTK)
|
| + !defined(TOOLKIT_GTK) && \
|
| + !defined(OS_ANDROID) \
|
| // We have subclassess of BrowserAccessibilityManager on Mac, Linux/GTK,
|
| // and Win. For any other platform, instantiate the base class.
|
| // static
|
| @@ -91,6 +92,10 @@ bool BrowserAccessibilityManager::IsOSKAllowed(const gfx::Rect& bounds) {
|
| return bounds.Contains(touch_point);
|
| }
|
|
|
| +bool BrowserAccessibilityManager::UseRootScrollOffsetsWhenComputingBounds() {
|
| + return true;
|
| +}
|
| +
|
| void BrowserAccessibilityManager::RemoveNode(BrowserAccessibility* node) {
|
| if (node == focus_)
|
| SetFocus(root_, false);
|
| @@ -158,6 +163,11 @@ void BrowserAccessibilityManager::SetFocus(
|
| delegate_->SetAccessibilityFocus(node->renderer_id());
|
| }
|
|
|
| +void BrowserAccessibilityManager::SetRoot(BrowserAccessibility* node) {
|
| + root_ = node;
|
| + NotifyRootChanged();
|
| +}
|
| +
|
| void BrowserAccessibilityManager::DoDefaultAction(
|
| const BrowserAccessibility& node) {
|
| if (delegate_)
|
| @@ -372,14 +382,16 @@ bool BrowserAccessibilityManager::UpdateNode(const AccessibilityNodeData& src) {
|
| if (root_)
|
| root_->Destroy();
|
| if (focus_ == root_)
|
| - focus_ = instance;
|
| - root_ = instance;
|
| + SetFocus(instance, false);
|
| + SetRoot(instance);
|
| }
|
|
|
| // Keep track of what node is focused.
|
| - if ((src.state >> AccessibilityNodeData::STATE_FOCUSED) & 1)
|
| + if (src.role != AccessibilityNodeData::ROLE_ROOT_WEB_AREA &&
|
| + src.role != AccessibilityNodeData::ROLE_WEB_AREA &&
|
| + (src.state >> AccessibilityNodeData::STATE_FOCUSED & 1)) {
|
| SetFocus(instance, false);
|
| -
|
| + }
|
| return success;
|
| }
|
|
|
|
|