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

Side by Side Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 510513003: Send Android accessibility event when object location changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_accessibility_focus_3
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/accessibility/browser_accessibility_android.h" 5 #include "content/browser/accessibility/browser_accessibility_android.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 8 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
9 #include "content/common/accessibility_messages.h" 9 #include "content/common/accessibility_messages.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 BrowserAccessibilityAndroid::BrowserAccessibilityAndroid() { 50 BrowserAccessibilityAndroid::BrowserAccessibilityAndroid() {
51 first_time_ = true; 51 first_time_ = true;
52 } 52 }
53 53
54 bool BrowserAccessibilityAndroid::IsNative() const { 54 bool BrowserAccessibilityAndroid::IsNative() const {
55 return true; 55 return true;
56 } 56 }
57 57
58 void BrowserAccessibilityAndroid::OnLocationChanged() {
59 manager()->NotifyAccessibilityEvent(ui::AX_EVENT_LOCATION_CHANGED, this);
60 }
61
58 bool BrowserAccessibilityAndroid::PlatformIsLeaf() const { 62 bool BrowserAccessibilityAndroid::PlatformIsLeaf() const {
59 if (InternalChildCount() == 0) 63 if (InternalChildCount() == 0)
60 return true; 64 return true;
61 65
62 // Iframes are always allowed to contain children. 66 // Iframes are always allowed to contain children.
63 if (IsIframe() || 67 if (IsIframe() ||
64 GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || 68 GetRole() == ui::AX_ROLE_ROOT_WEB_AREA ||
65 GetRole() == ui::AX_ROLE_WEB_AREA) { 69 GetRole() == ui::AX_ROLE_WEB_AREA) {
66 return false; 70 return false;
67 } 71 }
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 647 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
644 int count = 0; 648 int count = 0;
645 for (uint32 i = 0; i < PlatformChildCount(); i++) { 649 for (uint32 i = 0; i < PlatformChildCount(); i++) {
646 if (PlatformGetChild(i)->GetRole() == role) 650 if (PlatformGetChild(i)->GetRole() == role)
647 count++; 651 count++;
648 } 652 }
649 return count; 653 return count;
650 } 654 }
651 655
652 } // namespace content 656 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698