| 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/browser/accessibility/browser_accessibility.h" | 13 #include "content/browser/accessibility/browser_accessibility.h" |
| 14 #include "ui/accessibility/platform/ax_platform_node.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 class CONTENT_EXPORT BrowserAccessibilityAndroid : public BrowserAccessibility { | 18 class CONTENT_EXPORT BrowserAccessibilityAndroid : public BrowserAccessibility { |
| 18 public: | 19 public: |
| 20 static BrowserAccessibilityAndroid* GetFromUniqueId(int32_t unique_id); |
| 21 int32_t unique_id() const { return unique_id_; } |
| 22 |
| 19 // Overrides from BrowserAccessibility. | 23 // Overrides from BrowserAccessibility. |
| 20 void OnDataChanged() override; | 24 void OnDataChanged() override; |
| 21 bool IsNative() const override; | 25 bool IsNative() const override; |
| 22 void OnLocationChanged() override; | 26 void OnLocationChanged() override; |
| 23 base::string16 GetValue() const override; | 27 base::string16 GetValue() const override; |
| 24 | 28 |
| 25 bool PlatformIsLeaf() const override; | 29 bool PlatformIsLeaf() const override; |
| 26 | 30 |
| 27 bool IsCheckable() const; | 31 bool IsCheckable() const; |
| 28 bool IsChecked() const; | 32 bool IsChecked() const; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // adding |offset| to each one. | 134 // adding |offset| to each one. |
| 131 void GetWordBoundaries(std::vector<int32_t>* word_starts, | 135 void GetWordBoundaries(std::vector<int32_t>* word_starts, |
| 132 std::vector<int32_t>* word_ends, | 136 std::vector<int32_t>* word_ends, |
| 133 int offset); | 137 int offset); |
| 134 | 138 |
| 135 private: | 139 private: |
| 136 // This gives BrowserAccessibility::Create access to the class constructor. | 140 // This gives BrowserAccessibility::Create access to the class constructor. |
| 137 friend class BrowserAccessibility; | 141 friend class BrowserAccessibility; |
| 138 | 142 |
| 139 BrowserAccessibilityAndroid(); | 143 BrowserAccessibilityAndroid(); |
| 144 ~BrowserAccessibilityAndroid() override; |
| 140 | 145 |
| 141 bool HasOnlyTextChildren() const; | 146 bool HasOnlyTextChildren() const; |
| 142 bool HasOnlyTextAndImageChildren() const; | 147 bool HasOnlyTextAndImageChildren() const; |
| 143 bool IsIframe() const; | 148 bool IsIframe() const; |
| 144 | 149 |
| 145 void NotifyLiveRegionUpdate(base::string16& aria_live); | 150 void NotifyLiveRegionUpdate(base::string16& aria_live); |
| 146 | 151 |
| 147 int CountChildrenWithRole(ui::AXRole role) const; | 152 int CountChildrenWithRole(ui::AXRole role) const; |
| 148 | 153 |
| 149 static size_t CommonPrefixLength(const base::string16 a, | 154 static size_t CommonPrefixLength(const base::string16 a, |
| 150 const base::string16 b); | 155 const base::string16 b); |
| 151 static size_t CommonSuffixLength(const base::string16 a, | 156 static size_t CommonSuffixLength(const base::string16 a, |
| 152 const base::string16 b); | 157 const base::string16 b); |
| 153 static size_t CommonEndLengths(const base::string16 a, | 158 static size_t CommonEndLengths(const base::string16 a, |
| 154 const base::string16 b); | 159 const base::string16 b); |
| 155 | 160 |
| 156 base::string16 cached_text_; | 161 base::string16 cached_text_; |
| 157 bool first_time_; | 162 bool first_time_; |
| 158 base::string16 old_value_; | 163 base::string16 old_value_; |
| 159 base::string16 new_value_; | 164 base::string16 new_value_; |
| 165 int32_t unique_id_; |
| 160 | 166 |
| 161 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid); | 167 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid); |
| 162 }; | 168 }; |
| 163 | 169 |
| 164 } // namespace content | 170 } // namespace content |
| 165 | 171 |
| 166 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ | 172 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
| OLD | NEW |