Home | History | Annotate | Download | only in accessibility
      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   bool IsLeaf() const;
     20 
     21   bool IsCheckable() const;
     22   bool IsChecked() const;
     23   bool IsClickable() const;
     24   bool IsEnabled() const;
     25   bool IsFocusable() const;
     26   bool IsFocused() const;
     27   bool IsPassword() const;
     28   bool IsScrollable() const;
     29   bool IsSelected() const;
     30   bool IsVisibleToUser() const;
     31 
     32   const char* GetClassName() const;
     33   string16 GetText() const;
     34 
     35   int GetItemIndex() const;
     36   int GetItemCount() const;
     37 
     38   int GetScrollX() const;
     39   int GetScrollY() const;
     40   int GetMaxScrollX() const;
     41   int GetMaxScrollY() const;
     42 
     43   int GetTextChangeFromIndex() const;
     44   int GetTextChangeAddedCount() const;
     45   int GetTextChangeRemovedCount() const;
     46   string16 GetTextChangeBeforeText() const;
     47 
     48   int GetSelectionStart() const;
     49   int GetSelectionEnd() const;
     50   int GetEditableTextLength() const;
     51 
     52  private:
     53   // This gives BrowserAccessibility::Create access to the class constructor.
     54   friend class BrowserAccessibility;
     55 
     56   BrowserAccessibilityAndroid();
     57 
     58   bool HasFocusableChild() const;
     59   bool HasOnlyStaticTextChildren() const;
     60   bool IsIframe() const;
     61 
     62   void NotifyLiveRegionUpdate(string16& aria_live);
     63 
     64   string16 cached_text_;
     65   bool first_time_;
     66   string16 old_value_;
     67   string16 new_value_;
     68 
     69   DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid);
     70 };
     71 
     72 }  // namespace content
     73 
     74 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_ANDROID_H_
     75