| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // ensure that a termination of a renderer process gets propagated to the | 40 // ensure that a termination of a renderer process gets propagated to the |
| 41 // active BrowserAccessibility instances calling into it. Each such instance | 41 // active BrowserAccessibility instances calling into it. Each such instance |
| 42 // will upon such an event be set to an inactive state, failing calls from the | 42 // will upon such an event be set to an inactive state, failing calls from the |
| 43 // assistive technology gracefully. | 43 // assistive technology gracefully. |
| 44 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
| 45 class BrowserAccessibilityManager : public NotificationObserver { | 45 class BrowserAccessibilityManager : public NotificationObserver { |
| 46 public: | 46 public: |
| 47 // Gets the singleton BrowserAccessibilityManager object. The first time this | 47 // Gets the singleton BrowserAccessibilityManager object. The first time this |
| 48 // method is called, a CacheManagerHost object is constructed and returned. | 48 // method is called, a CacheManagerHost object is constructed and returned. |
| 49 // Subsequent calls will return the same object. | 49 // Subsequent calls will return the same object. |
| 50 static BrowserAccessibilityManager* Instance(); | 50 static BrowserAccessibilityManager* GetInstance(); |
| 51 | 51 |
| 52 // Creates an instance of BrowserAccessibility, initializes it and sets the | 52 // Creates an instance of BrowserAccessibility, initializes it and sets the |
| 53 // iaccessible_id and parent_id. | 53 // iaccessible_id and parent_id. |
| 54 STDMETHODIMP CreateAccessibilityInstance(REFIID iid, | 54 STDMETHODIMP CreateAccessibilityInstance(REFIID iid, |
| 55 int iaccessible_id, | 55 int iaccessible_id, |
| 56 int instance_id, | 56 int instance_id, |
| 57 void** interface_ptr); | 57 void** interface_ptr); |
| 58 | 58 |
| 59 // Composes and sends a message for requesting needed accessibility | 59 // Composes and sends a message for requesting needed accessibility |
| 60 // information. Unused LONG input parameters should be NULL, and the VARIANT | 60 // information. Unused LONG input parameters should be NULL, and the VARIANT |
| (...skipping 18 matching lines...) Expand all Loading... |
| 79 RenderWidgetHost* render_widget_host); | 79 RenderWidgetHost* render_widget_host); |
| 80 | 80 |
| 81 // NotificationObserver implementation. | 81 // NotificationObserver implementation. |
| 82 virtual void Observe(NotificationType type, | 82 virtual void Observe(NotificationType type, |
| 83 const NotificationSource& source, | 83 const NotificationSource& source, |
| 84 const NotificationDetails& details); | 84 const NotificationDetails& details); |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 // This class is a singleton. Do not instantiate directly. | 87 // This class is a singleton. Do not instantiate directly. |
| 88 BrowserAccessibilityManager(); | 88 BrowserAccessibilityManager(); |
| 89 friend DefaultSingletonTraits<BrowserAccessibilityManager>; | 89 friend struct DefaultSingletonTraits<BrowserAccessibilityManager>; |
| 90 | 90 |
| 91 ~BrowserAccessibilityManager(); | 91 ~BrowserAccessibilityManager(); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Caching of the unique member variables used to handle browser accessibility | 94 // Caching of the unique member variables used to handle browser accessibility |
| 95 // requests from multiple processes. | 95 // requests from multiple processes. |
| 96 InstanceMap instance_map_; | 96 InstanceMap instance_map_; |
| 97 int instance_id_; | 97 int instance_id_; |
| 98 | 98 |
| 99 // Reverse mapping to track which RenderProcessHosts are active. If a | 99 // Reverse mapping to track which RenderProcessHosts are active. If a |
| 100 // 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 |
| 101 // mapping, and the connected BrowserAccessibility ids/instances invalidated. | 101 // mapping, and the connected BrowserAccessibility ids/instances invalidated. |
| 102 RenderProcessHostMap render_process_host_map_; | 102 RenderProcessHostMap render_process_host_map_; |
| 103 | 103 |
| 104 ViewHostMsg_Accessibility_Out_Params out_params_; | 104 ViewHostMsg_Accessibility_Out_Params out_params_; |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 106 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 107 }; | 107 }; |
| 108 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ | 108 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |