| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 6 #define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/common/render_messages_params.h" | 14 #include "chrome/common/render_messages_params.h" |
| 15 #include "gfx/native_widget_types.h" | 15 #include "gfx/native_widget_types.h" |
| 16 #include "webkit/glue/webaccessibility.h" | 16 #include "webkit/glue/webaccessibility.h" |
| 17 | 17 |
| 18 | |
| 19 class BrowserAccessibility; | 18 class BrowserAccessibility; |
| 20 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 21 class BrowserAccessibilityManagerWin; | 20 class BrowserAccessibilityManagerWin; |
| 22 #endif | 21 #endif |
| 23 | 22 |
| 24 using webkit_glue::WebAccessibility; | 23 using webkit_glue::WebAccessibility; |
| 25 | 24 |
| 26 // Class that can perform actions on behalf of the BrowserAccessibilityManager. | 25 // Class that can perform actions on behalf of the BrowserAccessibilityManager. |
| 27 class BrowserAccessibilityDelegate { | 26 class BrowserAccessibilityDelegate { |
| 28 public: | 27 public: |
| 29 virtual ~BrowserAccessibilityDelegate() {} | 28 virtual ~BrowserAccessibilityDelegate() {} |
| 30 virtual void SetAccessibilityFocus(int acc_obj_id) = 0; | 29 virtual void SetAccessibilityFocus(int acc_obj_id) = 0; |
| 31 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; | 30 virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0; |
| 32 virtual bool HasFocus() = 0; | 31 virtual bool HasFocus() = 0; |
| 32 virtual gfx::Rect GetViewBounds() const = 0; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class BrowserAccessibilityFactory { | 35 class BrowserAccessibilityFactory { |
| 36 public: | 36 public: |
| 37 virtual ~BrowserAccessibilityFactory() {} | 37 virtual ~BrowserAccessibilityFactory() {} |
| 38 | 38 |
| 39 // Create an instance of BrowserAccessibility and return a new | 39 // Create an instance of BrowserAccessibility and return a new |
| 40 // reference to it. | 40 // reference to it. |
| 41 virtual BrowserAccessibility* Create(); | 41 virtual BrowserAccessibility* Create(); |
| 42 }; | 42 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Called to notify the accessibility manager that its associated native | 74 // Called to notify the accessibility manager that its associated native |
| 75 // view got focused. | 75 // view got focused. |
| 76 void GotFocus(); | 76 void GotFocus(); |
| 77 | 77 |
| 78 // Tell the renderer to set focus to this node. | 78 // Tell the renderer to set focus to this node. |
| 79 void SetFocus(const BrowserAccessibility& node); | 79 void SetFocus(const BrowserAccessibility& node); |
| 80 | 80 |
| 81 // Tell the renderer to do the default action for this node. | 81 // Tell the renderer to do the default action for this node. |
| 82 void DoDefaultAction(const BrowserAccessibility& node); | 82 void DoDefaultAction(const BrowserAccessibility& node); |
| 83 | 83 |
| 84 // Retrieve the bounds of the parent View in screen coordinates. |
| 85 gfx::Rect GetViewBounds(); |
| 86 |
| 84 // Called when the renderer process has notified us of about tree changes. | 87 // Called when the renderer process has notified us of about tree changes. |
| 85 // Send a notification to MSAA clients of the change. | 88 // Send a notification to MSAA clients of the change. |
| 86 void OnAccessibilityNotifications( | 89 void OnAccessibilityNotifications( |
| 87 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); | 90 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); |
| 88 | 91 |
| 89 gfx::NativeView GetParentView(); | 92 gfx::NativeView GetParentView(); |
| 90 | 93 |
| 91 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
| 92 BrowserAccessibilityManagerWin* toBrowserAccessibilityManagerWin(); | 95 BrowserAccessibilityManagerWin* toBrowserAccessibilityManagerWin(); |
| 93 #endif | 96 #endif |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // we use internally here. | 170 // we use internally here. |
| 168 base::hash_map<int, int32> renderer_id_to_child_id_map_; | 171 base::hash_map<int, int32> renderer_id_to_child_id_map_; |
| 169 | 172 |
| 170 // A mapping from child IDs to BrowserAccessibility objects. | 173 // A mapping from child IDs to BrowserAccessibility objects. |
| 171 base::hash_map<int32, BrowserAccessibility*> child_id_map_; | 174 base::hash_map<int32, BrowserAccessibility*> child_id_map_; |
| 172 | 175 |
| 173 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 176 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 174 }; | 177 }; |
| 175 | 178 |
| 176 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 179 #endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |