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_MANAGER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_ANDROID_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_ANDROID_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const base::android::JavaParamRef<jobject>& obj, | 207 const base::android::JavaParamRef<jobject>& obj, |
208 jint id); | 208 jint id); |
209 | 209 |
210 // Scrolls any scrollable container by about 80% of one page in the | 210 // Scrolls any scrollable container by about 80% of one page in the |
211 // given direction. | 211 // given direction. |
212 bool Scroll(JNIEnv* env, | 212 bool Scroll(JNIEnv* env, |
213 const base::android::JavaParamRef<jobject>& obj, | 213 const base::android::JavaParamRef<jobject>& obj, |
214 jint id, | 214 jint id, |
215 int direction); | 215 int direction); |
216 | 216 |
| 217 JavaObjectWeakGlobalRef& java_ref() { return java_ref_; } |
| 218 |
217 protected: | 219 protected: |
218 // AXTreeDelegate overrides. | 220 // AXTreeDelegate overrides. |
219 void OnAtomicUpdateFinished( | 221 void OnAtomicUpdateFinished( |
220 ui::AXTree* tree, | 222 ui::AXTree* tree, |
221 bool root_changed, | 223 bool root_changed, |
222 const std::vector<ui::AXTreeDelegate::Change>& changes) override; | 224 const std::vector<ui::AXTreeDelegate::Change>& changes) override; |
223 | 225 |
224 bool UseRootScrollOffsetsWhenComputingBounds() override; | 226 bool UseRootScrollOffsetsWhenComputingBounds() override; |
225 | 227 |
226 private: | 228 private: |
227 BrowserAccessibilityAndroid* GetFromUniqueID(int32_t unique_id); | 229 BrowserAccessibilityAndroid* GetFromUniqueID(int32_t unique_id); |
228 | 230 |
| 231 base::android::ScopedJavaLocalRef<jobject> GetJavaRefFromRootManager(); |
| 232 |
229 // This gives BrowserAccessibilityManager::Create access to the class | 233 // This gives BrowserAccessibilityManager::Create access to the class |
230 // constructor. | 234 // constructor. |
231 friend class BrowserAccessibilityManager; | 235 friend class BrowserAccessibilityManager; |
232 | 236 |
233 // A weak reference to the Java BrowserAccessibilityManager object. | 237 // A weak reference to the Java BrowserAccessibilityManager object. |
234 // This avoids adding another reference to BrowserAccessibilityManager and | 238 // This avoids adding another reference to BrowserAccessibilityManager and |
235 // preventing garbage collection. | 239 // preventing garbage collection. |
236 // Premature garbage collection is prevented by the long-lived reference in | 240 // Premature garbage collection is prevented by the long-lived reference in |
237 // ContentViewCore. | 241 // ContentViewCore. |
238 JavaObjectWeakGlobalRef java_ref_; | 242 JavaObjectWeakGlobalRef java_ref_; |
239 | 243 |
240 // Handle a hover event from the renderer process. | 244 // Handle a hover event from the renderer process. |
241 void HandleHoverEvent(BrowserAccessibility* node); | 245 void HandleHoverEvent(BrowserAccessibility* node); |
242 | 246 |
243 // See docs for set_prune_tree_for_screen_reader, above. | 247 // See docs for set_prune_tree_for_screen_reader, above. |
244 bool prune_tree_for_screen_reader_; | 248 bool prune_tree_for_screen_reader_; |
245 | 249 |
246 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerAndroid); | 250 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerAndroid); |
247 }; | 251 }; |
248 | 252 |
249 bool RegisterBrowserAccessibilityManager(JNIEnv* env); | 253 bool RegisterBrowserAccessibilityManager(JNIEnv* env); |
250 | 254 |
251 } | 255 } |
252 | 256 |
253 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_ANDROID_H
_ | 257 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_ANDROID_H
_ |
OLD | NEW |