OLD | NEW |
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/i18n/break_iterator.h" | 7 #include "base/i18n/break_iterator.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 if (GetString16Attribute( | 852 if (GetString16Attribute( |
853 ui::AX_ATTR_CONTAINER_LIVE_STATUS, &live)) { | 853 ui::AX_ATTR_CONTAINER_LIVE_STATUS, &live)) { |
854 NotifyLiveRegionUpdate(live); | 854 NotifyLiveRegionUpdate(live); |
855 } | 855 } |
856 | 856 |
857 first_time_ = false; | 857 first_time_ = false; |
858 } | 858 } |
859 | 859 |
860 void BrowserAccessibilityAndroid::NotifyLiveRegionUpdate( | 860 void BrowserAccessibilityAndroid::NotifyLiveRegionUpdate( |
861 base::string16& aria_live) { | 861 base::string16& aria_live) { |
862 if (!EqualsASCII(aria_live, aria_strings::kAriaLivePolite) && | 862 if (!base::EqualsASCII(aria_live, aria_strings::kAriaLivePolite) && |
863 !EqualsASCII(aria_live, aria_strings::kAriaLiveAssertive)) | 863 !base::EqualsASCII(aria_live, aria_strings::kAriaLiveAssertive)) |
864 return; | 864 return; |
865 | 865 |
866 base::string16 text = GetText(); | 866 base::string16 text = GetText(); |
867 if (cached_text_ != text) { | 867 if (cached_text_ != text) { |
868 if (!text.empty()) { | 868 if (!text.empty()) { |
869 manager()->NotifyAccessibilityEvent(ui::AX_EVENT_SHOW, | 869 manager()->NotifyAccessibilityEvent(ui::AX_EVENT_SHOW, |
870 this); | 870 this); |
871 } | 871 } |
872 cached_text_ = text; | 872 cached_text_ = text; |
873 } | 873 } |
874 } | 874 } |
875 | 875 |
876 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 876 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
877 int count = 0; | 877 int count = 0; |
878 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 878 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
879 if (PlatformGetChild(i)->GetRole() == role) | 879 if (PlatformGetChild(i)->GetRole() == role) |
880 count++; | 880 count++; |
881 } | 881 } |
882 return count; | 882 return count; |
883 } | 883 } |
884 | 884 |
885 } // namespace content | 885 } // namespace content |
OLD | NEW |