OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "content/browser/accessibility/browser_accessibility.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 class BrowserAccessibilityAndroid : public BrowserAccessibility { |
| 14 public: |
| 15 // Overrides from BrowserAccessibility. |
| 16 virtual void PostInitialize() OVERRIDE; |
| 17 virtual bool IsNative() const OVERRIDE; |
| 18 |
| 19 // -------------------------------------------------------------------------- |
| 20 // Methods called from Java via JNI |
| 21 // -------------------------------------------------------------------------- |
| 22 |
| 23 // Actions |
| 24 void FocusJNI(JNIEnv* env, jobject obj); |
| 25 void ClickJNI(JNIEnv* env, jobject obj); |
| 26 |
| 27 // Const accessors |
| 28 jboolean GetClickableJNI(JNIEnv* env, jobject obj) const; |
| 29 jboolean IsFocusedJNI(JNIEnv* env, jobject obj) const; |
| 30 jboolean IsEditableTextJNI(JNIEnv* env, jobject obj) const; |
| 31 base::android::ScopedJavaLocalRef<jstring> GetNameJNI( |
| 32 JNIEnv* env, jobject obj) const; |
| 33 base::android::ScopedJavaLocalRef<jobject> GetAbsoluteRectJNI( |
| 34 JNIEnv* env, jobject obj) const; |
| 35 base::android::ScopedJavaLocalRef<jobject> GetRectInParentJNI( |
| 36 JNIEnv* env, jobject obj) const; |
| 37 jboolean IsFocusableJNI(JNIEnv* env, jobject obj) const; |
| 38 jint GetParentJNI(JNIEnv* env, jobject obj) const; |
| 39 jint GetChildCountJNI(JNIEnv* env, jobject obj) const; |
| 40 jint GetChildIdAtJNI( |
| 41 JNIEnv* env, jobject obj, jint child_index) const; |
| 42 jboolean IsCheckableJNI(JNIEnv* env, jobject obj) const; |
| 43 jboolean IsCheckedJNI(JNIEnv* env, jobject obj) const; |
| 44 base::android::ScopedJavaLocalRef<jstring> GetClassNameJNI( |
| 45 JNIEnv* env, jobject obj) const; |
| 46 jboolean IsEnabledJNI(JNIEnv* env, jobject obj) const; |
| 47 jboolean IsPasswordJNI(JNIEnv* env, jobject obj) const; |
| 48 jboolean IsScrollableJNI(JNIEnv* env, jobject obj) const; |
| 49 jboolean IsSelectedJNI(JNIEnv* env, jobject obj) const; |
| 50 jboolean IsVisibleJNI(JNIEnv* env, jobject obj) const; |
| 51 jint GetItemIndexJNI(JNIEnv* env, jobject obj) const; |
| 52 jint GetItemCountJNI(JNIEnv* env, jobject obj) const; |
| 53 jint GetScrollXJNI(JNIEnv* env, jobject obj) const; |
| 54 jint GetScrollYJNI(JNIEnv* env, jobject obj) const; |
| 55 jint GetMaxScrollXJNI(JNIEnv* env, jobject obj) const; |
| 56 jint GetMaxScrollYJNI(JNIEnv* env, jobject obj) const; |
| 57 base::android::ScopedJavaLocalRef<jstring> GetAriaLiveJNI( |
| 58 JNIEnv* env, jobject obj) const; |
| 59 jint GetSelectionStartJNI(JNIEnv* env, jobject obj) const; |
| 60 jint GetSelectionEndJNI(JNIEnv* env, jobject obj) const; |
| 61 jint GetEditableTextLengthJNI(JNIEnv* env, jobject obj) const; |
| 62 jint GetTextChangeFromIndexJNI(JNIEnv* env, jobject obj) const; |
| 63 jint GetTextChangeAddedCountJNI(JNIEnv* env, jobject obj) const; |
| 64 jint GetTextChangeRemovedCountJNI(JNIEnv* env, jobject obj) const; |
| 65 base::android::ScopedJavaLocalRef<jstring> GetTextChangeBeforeTextJNI( |
| 66 JNIEnv* env, jobject obj) const; |
| 67 |
| 68 private: |
| 69 // This gives BrowserAccessibility::Create access to the class constructor. |
| 70 friend class BrowserAccessibility; |
| 71 |
| 72 // Allow BrowserAccessibilityManagerAndroid to call these private methods. |
| 73 friend class BrowserAccessibilityManagerAndroid; |
| 74 |
| 75 BrowserAccessibilityAndroid(); |
| 76 |
| 77 string16 ComputeName() const; |
| 78 string16 GetAriaLive() const; |
| 79 bool IsFocusable() const; |
| 80 bool HasFocusableChild() const; |
| 81 bool HasOnlyStaticTextChildren() const; |
| 82 bool IsIframe() const; |
| 83 bool IsLeaf() const; |
| 84 |
| 85 void NotifyLiveRegionUpdate(string16& aria_live); |
| 86 |
| 87 string16 cached_text_; |
| 88 bool first_time_; |
| 89 string16 old_value_; |
| 90 string16 new_value_; |
| 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid); |
| 93 }; |
| 94 |
| 95 bool RegisterBrowserAccessibility(JNIEnv* env); |
| 96 |
| 97 } // namespace content |
| 98 |
| 99 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ |
OLD | NEW |