| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const ui::AXNodeData& node5 = ui::AXNodeData(), | 38 const ui::AXNodeData& node5 = ui::AXNodeData(), |
| 39 const ui::AXNodeData& node6 = ui::AXNodeData(), | 39 const ui::AXNodeData& node6 = ui::AXNodeData(), |
| 40 const ui::AXNodeData& node7 = ui::AXNodeData(), | 40 const ui::AXNodeData& node7 = ui::AXNodeData(), |
| 41 const ui::AXNodeData& node8 = ui::AXNodeData(), | 41 const ui::AXNodeData& node8 = ui::AXNodeData(), |
| 42 const ui::AXNodeData& node9 = ui::AXNodeData()); | 42 const ui::AXNodeData& node9 = ui::AXNodeData()); |
| 43 | 43 |
| 44 // Class that can perform actions on behalf of the BrowserAccessibilityManager. | 44 // Class that can perform actions on behalf of the BrowserAccessibilityManager. |
| 45 class CONTENT_EXPORT BrowserAccessibilityDelegate { | 45 class CONTENT_EXPORT BrowserAccessibilityDelegate { |
| 46 public: | 46 public: |
| 47 virtual ~BrowserAccessibilityDelegate() {} | 47 virtual ~BrowserAccessibilityDelegate() {} |
| 48 virtual void SetAccessibilityFocus(int acc_obj_id) = 0; | 48 virtual void AccessibilitySetFocus(int acc_obj_id) = 0; |
| 49 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; | 49 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; |
| 50 virtual void AccessibilityShowMenu(int acc_obj_id) = 0; |
| 50 virtual void AccessibilityScrollToMakeVisible( | 51 virtual void AccessibilityScrollToMakeVisible( |
| 51 int acc_obj_id, gfx::Rect subfocus) = 0; | 52 int acc_obj_id, gfx::Rect subfocus) = 0; |
| 52 virtual void AccessibilityScrollToPoint( | 53 virtual void AccessibilityScrollToPoint( |
| 53 int acc_obj_id, gfx::Point point) = 0; | 54 int acc_obj_id, gfx::Point point) = 0; |
| 54 virtual void AccessibilitySetTextSelection( | 55 virtual void AccessibilitySetTextSelection( |
| 55 int acc_obj_id, int start_offset, int end_offset) = 0; | 56 int acc_obj_id, int start_offset, int end_offset) = 0; |
| 56 virtual bool HasFocus() const = 0; | 57 virtual bool AccessibilityViewHasFocus() const = 0; |
| 57 virtual gfx::Rect GetViewBounds() const = 0; | 58 virtual gfx::Rect AccessibilityGetViewBounds() const = 0; |
| 58 virtual gfx::Point GetLastTouchEventLocation() const = 0; | 59 virtual gfx::Point AccessibilityOriginInScreen( |
| 59 virtual void FatalAccessibilityTreeError() = 0; | 60 const gfx::Rect& bounds) const = 0; |
| 61 virtual void AccessibilityFatalError() = 0; |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 class CONTENT_EXPORT BrowserAccessibilityFactory { | 64 class CONTENT_EXPORT BrowserAccessibilityFactory { |
| 63 public: | 65 public: |
| 64 virtual ~BrowserAccessibilityFactory() {} | 66 virtual ~BrowserAccessibilityFactory() {} |
| 65 | 67 |
| 66 // Create an instance of BrowserAccessibility and return a new | 68 // Create an instance of BrowserAccessibility and return a new |
| 67 // reference to it. | 69 // reference to it. |
| 68 virtual BrowserAccessibility* Create(); | 70 virtual BrowserAccessibility* Create(); |
| 69 }; | 71 }; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 #endif | 153 #endif |
| 152 | 154 |
| 153 #if defined(OS_ANDROID) | 155 #if defined(OS_ANDROID) |
| 154 BrowserAccessibilityManagerAndroid* ToBrowserAccessibilityManagerAndroid(); | 156 BrowserAccessibilityManagerAndroid* ToBrowserAccessibilityManagerAndroid(); |
| 155 #endif | 157 #endif |
| 156 | 158 |
| 157 // Return the object that has focus, if it's a descandant of the | 159 // Return the object that has focus, if it's a descandant of the |
| 158 // given root (inclusive). Does not make a new reference. | 160 // given root (inclusive). Does not make a new reference. |
| 159 BrowserAccessibility* GetFocus(BrowserAccessibility* root); | 161 BrowserAccessibility* GetFocus(BrowserAccessibility* root); |
| 160 | 162 |
| 161 // Is the on-screen keyboard allowed to be shown, in response to a | |
| 162 // focus event on a text box? | |
| 163 bool IsOSKAllowed(const gfx::Rect& bounds); | |
| 164 | |
| 165 // True by default, but some platforms want to treat the root | 163 // True by default, but some platforms want to treat the root |
| 166 // scroll offsets separately. | 164 // scroll offsets separately. |
| 167 virtual bool UseRootScrollOffsetsWhenComputingBounds(); | 165 virtual bool UseRootScrollOffsetsWhenComputingBounds(); |
| 168 | 166 |
| 169 // Walk the tree. | 167 // Walk the tree. |
| 170 BrowserAccessibility* NextInTreeOrder(BrowserAccessibility* node); | 168 BrowserAccessibility* NextInTreeOrder(BrowserAccessibility* node); |
| 171 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); | 169 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); |
| 172 | 170 |
| 173 // AXTreeDelegate implementation. | 171 // AXTreeDelegate implementation. |
| 174 virtual void OnNodeWillBeDeleted(ui::AXNode* node) OVERRIDE; | 172 virtual void OnNodeWillBeDeleted(ui::AXNode* node) OVERRIDE; |
| 175 virtual void OnNodeCreated(ui::AXNode* node) OVERRIDE; | 173 virtual void OnNodeCreated(ui::AXNode* node) OVERRIDE; |
| 176 virtual void OnNodeChanged(ui::AXNode* node) OVERRIDE; | 174 virtual void OnNodeChanged(ui::AXNode* node) OVERRIDE; |
| 177 virtual void OnNodeCreationFinished(ui::AXNode* node) OVERRIDE; | 175 virtual void OnNodeCreationFinished(ui::AXNode* node) OVERRIDE; |
| 178 virtual void OnNodeChangeFinished(ui::AXNode* node) OVERRIDE; | 176 virtual void OnNodeChangeFinished(ui::AXNode* node) OVERRIDE; |
| 179 virtual void OnRootChanged(ui::AXNode* new_root) OVERRIDE {} | 177 virtual void OnRootChanged(ui::AXNode* new_root) OVERRIDE {} |
| 180 | 178 |
| 179 BrowserAccessibilityDelegate* delegate() const { return delegate_; } |
| 180 |
| 181 protected: | 181 protected: |
| 182 BrowserAccessibilityManager( | 182 BrowserAccessibilityManager( |
| 183 BrowserAccessibilityDelegate* delegate, | 183 BrowserAccessibilityDelegate* delegate, |
| 184 BrowserAccessibilityFactory* factory); | 184 BrowserAccessibilityFactory* factory); |
| 185 | 185 |
| 186 BrowserAccessibilityManager( | 186 BrowserAccessibilityManager( |
| 187 const ui::AXTreeUpdate& initial_tree, | 187 const ui::AXTreeUpdate& initial_tree, |
| 188 BrowserAccessibilityDelegate* delegate, | 188 BrowserAccessibilityDelegate* delegate, |
| 189 BrowserAccessibilityFactory* factory); | 189 BrowserAccessibilityFactory* factory); |
| 190 | 190 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 // The on-screen keyboard state. | 245 // The on-screen keyboard state. |
| 246 OnScreenKeyboardState osk_state_; | 246 OnScreenKeyboardState osk_state_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 248 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 } // namespace content | 251 } // namespace content |
| 252 | 252 |
| 253 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 253 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |