OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BROWSER_ACCESSIBILITY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ |
6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ | 6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ |
7 | 7 |
8 #include <oaidl.h> // Needed for VARIANT structure. | 8 #include <oaidl.h> // Needed for VARIANT structure. |
9 #include <hash_map> | 9 #include <hash_map> |
10 | 10 |
11 #include "base/singleton.h" | 11 #include "base/singleton.h" |
| 12 #include "chrome/common/accessibility.h" |
12 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
13 #include "chrome/common/render_messages.h" | |
14 | 14 |
15 class BrowserAccessibility; | 15 class BrowserAccessibility; |
16 class RenderProcessHost; | 16 class RenderProcessHost; |
17 class RenderWidgetHost; | 17 class RenderWidgetHost; |
18 struct ViewHostMsg_Accessibility_Out_Params; | |
19 | 18 |
20 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
21 // | 20 // |
22 // BrowserAccessibilityManager | 21 // BrowserAccessibilityManager |
23 // | 22 // |
24 // Used to manage instance creation and memory handling for browser side | 23 // Used to manage instance creation and memory handling for browser side |
25 // accessibility. A singleton class. It implements NotificationObserver to | 24 // accessibility. A singleton class. It implements NotificationObserver to |
26 // ensure that a termination of a renderer process gets propagated to the | 25 // ensure that a termination of a renderer process gets propagated to the |
27 // active BrowserAccessibility instances calling into it. Each such instance | 26 // active BrowserAccessibility instances calling into it. Each such instance |
28 // will upon such an event be set to an inactive state, failing calls from the | 27 // will upon such an event be set to an inactive state, failing calls from the |
(...skipping 17 matching lines...) Expand all Loading... |
46 // information. Unused LONG input parameters should be NULL, and the VARIANT | 45 // information. Unused LONG input parameters should be NULL, and the VARIANT |
47 // an empty, valid instance. | 46 // an empty, valid instance. |
48 bool RequestAccessibilityInfo(int iaccessible_id, | 47 bool RequestAccessibilityInfo(int iaccessible_id, |
49 int instance_id, | 48 int instance_id, |
50 int iaccessible_func_id, | 49 int iaccessible_func_id, |
51 VARIANT var_id, | 50 VARIANT var_id, |
52 LONG input1, | 51 LONG input1, |
53 LONG input2); | 52 LONG input2); |
54 | 53 |
55 // Wrapper function, for cleaner code. | 54 // Wrapper function, for cleaner code. |
56 const ViewHostMsg_Accessibility_Out_Params& response(); | 55 const AccessibilityOutParams& response(); |
57 | 56 |
58 // Retrieves the parent HWND connected to the provided id. | 57 // Retrieves the parent HWND connected to the provided id. |
59 HWND parent_hwnd(int id); | 58 HWND parent_hwnd(int id); |
60 | 59 |
61 // Mutator, needed since constructor does not take any arguments, and to keep | 60 // Mutator, needed since constructor does not take any arguments, and to keep |
62 // instance accessor clean. | 61 // instance accessor clean. |
63 int SetMembers(BrowserAccessibility* browser_acc, | 62 int SetMembers(BrowserAccessibility* browser_acc, |
64 HWND parent_hwnd, | 63 HWND parent_hwnd, |
65 RenderWidgetHost* render_widget_host); | 64 RenderWidgetHost* render_widget_host); |
66 | 65 |
(...skipping 28 matching lines...) Expand all Loading... |
95 // Caching of the unique member variables used to handle browser accessibility | 94 // Caching of the unique member variables used to handle browser accessibility |
96 // requests from multiple processes. | 95 // requests from multiple processes. |
97 InstanceMap instance_map_; | 96 InstanceMap instance_map_; |
98 int instance_id_; | 97 int instance_id_; |
99 | 98 |
100 // Reverse mapping to track which RenderProcessHosts are active. If a | 99 // Reverse mapping to track which RenderProcessHosts are active. If a |
101 // RenderProcessHost is found to be terminated, it should be removed from this | 100 // RenderProcessHost is found to be terminated, it should be removed from this |
102 // mapping, and the connected BrowserAccessibility ids/instances invalidated. | 101 // mapping, and the connected BrowserAccessibility ids/instances invalidated. |
103 RenderProcessHostMap render_process_host_map_; | 102 RenderProcessHostMap render_process_host_map_; |
104 | 103 |
105 ViewHostMsg_Accessibility_Out_Params out_params_; | 104 AccessibilityOutParams out_params_; |
106 | 105 |
107 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 106 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
108 }; | 107 }; |
109 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ | 108 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ |
OLD | NEW |