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