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 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 virtual bool PlatformIsLeaf() const OVERRIDE; 20 21 bool IsCheckable() const; 22 bool IsChecked() const; 23 bool IsClickable() const; 24 bool IsCollection() const; 25 bool IsCollectionItem() const; 26 bool IsContentInvalid() const; 27 bool IsDismissable() const; 28 bool IsEnabled() const; 29 bool IsFocusable() const; 30 bool IsFocused() const; 31 bool IsHeading() const; 32 bool IsHierarchical() const; 33 bool IsMultiLine() const; 34 bool IsPassword() const; 35 bool IsRangeType() const; 36 bool IsScrollable() const; 37 bool IsSelected() const; 38 bool IsVisibleToUser() const; 39 40 bool CanOpenPopup() const; 41 42 const char* GetClassName() const; 43 base::string16 GetText() const; 44 45 int GetItemIndex() const; 46 int GetItemCount() const; 47 48 int GetScrollX() const; 49 int GetScrollY() const; 50 int GetMaxScrollX() const; 51 int GetMaxScrollY() const; 52 53 int GetTextChangeFromIndex() const; 54 int GetTextChangeAddedCount() const; 55 int GetTextChangeRemovedCount() const; 56 base::string16 GetTextChangeBeforeText() const; 57 58 int GetSelectionStart() const; 59 int GetSelectionEnd() const; 60 int GetEditableTextLength() const; 61 62 int AndroidInputType() const; 63 int AndroidLiveRegionType() const; 64 int AndroidRangeType() const; 65 66 int RowCount() const; 67 int ColumnCount() const; 68 69 int RowIndex() const; 70 int RowSpan() const; 71 int ColumnIndex() const; 72 int ColumnSpan() const; 73 74 float RangeMin() const; 75 float RangeMax() const; 76 float RangeCurrentValue() const; 77 78 private: 79 // This gives BrowserAccessibility::Create access to the class constructor. 80 friend class BrowserAccessibility; 81 82 BrowserAccessibilityAndroid(); 83 84 bool HasFocusableChild() const; 85 bool HasOnlyStaticTextChildren() const; 86 bool IsIframe() const; 87 88 void NotifyLiveRegionUpdate(base::string16& aria_live); 89 90 int CountChildrenWithRole(blink::WebAXRole role) const; 91 92 base::string16 cached_text_; 93 bool first_time_; 94 base::string16 old_value_; 95 base::string16 new_value_; 96 97 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid); 98 }; 99 100 } // namespace content 101 102 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_ 103