| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using webkit_glue::WebAccessibility; | 23 using webkit_glue::WebAccessibility; |
| 24 | 24 |
| 25 struct ViewHostMsg_AccessibilityNotification_Params; | 25 struct ViewHostMsg_AccessibilityNotification_Params; |
| 26 | 26 |
| 27 // Class that can perform actions on behalf of the BrowserAccessibilityManager. | 27 // Class that can perform actions on behalf of the BrowserAccessibilityManager. |
| 28 class CONTENT_EXPORT BrowserAccessibilityDelegate { | 28 class CONTENT_EXPORT BrowserAccessibilityDelegate { |
| 29 public: | 29 public: |
| 30 virtual ~BrowserAccessibilityDelegate() {} | 30 virtual ~BrowserAccessibilityDelegate() {} |
| 31 virtual void SetAccessibilityFocus(int acc_obj_id) = 0; | 31 virtual void SetAccessibilityFocus(int acc_obj_id) = 0; |
| 32 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; | 32 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; |
| 33 virtual void AccessibilityChangeScrollPosition( |
| 34 int acc_obj_id, int scroll_x, int scroll_y) = 0; |
| 35 virtual void AccessibilitySetTextSelection( |
| 36 int acc_obj_id, int start_offset, int end_offset) = 0; |
| 33 virtual bool HasFocus() const = 0; | 37 virtual bool HasFocus() const = 0; |
| 34 virtual gfx::Rect GetViewBounds() const = 0; | 38 virtual gfx::Rect GetViewBounds() const = 0; |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 class CONTENT_EXPORT BrowserAccessibilityFactory { | 41 class CONTENT_EXPORT BrowserAccessibilityFactory { |
| 38 public: | 42 public: |
| 39 virtual ~BrowserAccessibilityFactory() {} | 43 virtual ~BrowserAccessibilityFactory() {} |
| 40 | 44 |
| 41 // Create an instance of BrowserAccessibility and return a new | 45 // Create an instance of BrowserAccessibility and return a new |
| 42 // reference to it. | 46 // reference to it. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 void GotFocus(); | 97 void GotFocus(); |
| 94 | 98 |
| 95 // Update the focused node to |node|, which may be null. | 99 // Update the focused node to |node|, which may be null. |
| 96 // If |notify| is true, send a message to the renderer to set focus | 100 // If |notify| is true, send a message to the renderer to set focus |
| 97 // to this node. | 101 // to this node. |
| 98 void SetFocus(BrowserAccessibility* node, bool notify); | 102 void SetFocus(BrowserAccessibility* node, bool notify); |
| 99 | 103 |
| 100 // Tell the renderer to do the default action for this node. | 104 // Tell the renderer to do the default action for this node. |
| 101 void DoDefaultAction(const BrowserAccessibility& node); | 105 void DoDefaultAction(const BrowserAccessibility& node); |
| 102 | 106 |
| 107 // Tell the renderer to scroll this node to the given position. |
| 108 void ChangeScrollPosition( |
| 109 const BrowserAccessibility& node, int scroll_x, int scroll_y); |
| 110 |
| 111 // Tell the renderer to set the text selection on a node. |
| 112 void SetTextSelection( |
| 113 const BrowserAccessibility& node, int start_offset, int end_offset); |
| 114 |
| 103 // Retrieve the bounds of the parent View in screen coordinates. | 115 // Retrieve the bounds of the parent View in screen coordinates. |
| 104 gfx::Rect GetViewBounds(); | 116 gfx::Rect GetViewBounds(); |
| 105 | 117 |
| 106 // Called when the renderer process has notified us of about tree changes. | 118 // Called when the renderer process has notified us of about tree changes. |
| 107 // Send a notification to MSAA clients of the change. | 119 // Send a notification to MSAA clients of the change. |
| 108 void OnAccessibilityNotifications( | 120 void OnAccessibilityNotifications( |
| 109 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); | 121 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); |
| 110 | 122 |
| 111 gfx::NativeView GetParentView(); | 123 gfx::NativeView GetParentView(); |
| 112 | 124 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // we use internally here. | 174 // we use internally here. |
| 163 base::hash_map<int32, int32> renderer_id_to_child_id_map_; | 175 base::hash_map<int32, int32> renderer_id_to_child_id_map_; |
| 164 | 176 |
| 165 // A mapping from child IDs to BrowserAccessibility objects. | 177 // A mapping from child IDs to BrowserAccessibility objects. |
| 166 base::hash_map<int32, BrowserAccessibility*> child_id_map_; | 178 base::hash_map<int32, BrowserAccessibility*> child_id_map_; |
| 167 | 179 |
| 168 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 180 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 169 }; | 181 }; |
| 170 | 182 |
| 171 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 183 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |