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

Unified Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 1761633002: One accessibility tree per frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix is-richly-editable test Created 4 years, 9 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
Index: content/browser/accessibility/browser_accessibility_android.cc
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
index 3cc4c5ec28f788e80dab529c74837def527eeada..09daafe6a6d906af42adc57a9a1d0d02283a1a4b 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -303,7 +303,10 @@ const char* BrowserAccessibilityAndroid::GetClassName() const {
class_name = "android.app.Dialog";
break;
case ui::AX_ROLE_ROOT_WEB_AREA:
- class_name = "android.webkit.WebView";
+ if (GetParent() == nullptr)
+ class_name = "android.webkit.WebView";
+ else
+ class_name = "android.view.View";
break;
case ui::AX_ROLE_MENU_ITEM:
case ui::AX_ROLE_MENU_ITEM_CHECK_BOX:
@@ -935,13 +938,13 @@ bool BrowserAccessibilityAndroid::Scroll(int direction) const {
// Figure out the bounding box of the visible portion of this scrollable
// view so we know how much to scroll by.
gfx::Rect bounds;
- if (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA) {
+ if (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA && !GetParent()) {
// If this is the root web area, use the bounds of the view to determine
// how big one page is.
if (!manager()->delegate())
return false;
bounds = manager()->delegate()->AccessibilityGetViewBounds();
- } else if (GetRole() == ui::AX_ROLE_WEB_AREA) {
+ } else if (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA && GetParent()) {
// If this is a web area inside of an iframe, try to use the bounds of
// the containing element.
BrowserAccessibility* parent = GetParent();

Powered by Google App Engine
This is Rietveld 408576698