| 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 WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ | 5 #ifndef WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
| 6 #define WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ | 6 #define WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
| 7 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <oleacc.h> | 9 #include <oleacc.h> |
| 10 #else | 10 #else |
| 11 // TODO(port): need an equivalent of | 11 // TODO(port): need an equivalent of |
| 12 // http://msdn.microsoft.com/en-us/library/accessibility.iaccessible.aspx | 12 // http://msdn.microsoft.com/en-us/library/accessibility.iaccessible.aspx |
| 13 class IAccessible; | 13 class IAccessible; |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "base/hash_tables.h" | 16 #include "base/hash_tables.h" |
| 17 #include "chrome/common/render_messages.h" | 17 #include "base/ref_counted.h" |
| 18 #include "chrome/common/accessibility.h" |
| 18 | 19 |
| 19 class WebView; | 20 class WebView; |
| 20 | 21 |
| 21 template <typename T> class COMPtr; | 22 template <typename T> class COMPtr; |
| 22 | 23 |
| 23 typedef base::hash_map<int, scoped_refptr<IAccessible> > IntToIAccessibleMap; | 24 typedef base::hash_map<int, scoped_refptr<IAccessible> > IntToIAccessibleMap; |
| 24 typedef base::hash_map<IAccessible*, int> IAccessibleToIntMap; | 25 typedef base::hash_map<IAccessible*, int> IAccessibleToIntMap; |
| 25 | 26 |
| 26 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 27 // | 28 // |
| 28 // GlueAccessibility | 29 // GlueAccessibility |
| 29 // | 30 // |
| 30 // Operations that access the underlying WebKit DOM directly, exposing | 31 // Operations that access the underlying WebKit DOM directly, exposing |
| 31 // accessibility information. | 32 // accessibility information. |
| 32 //////////////////////////////////////////////////////////////////////////////// | 33 //////////////////////////////////////////////////////////////////////////////// |
| 33 class GlueAccessibility { | 34 class GlueAccessibility { |
| 34 public: | 35 public: |
| 35 GlueAccessibility(); | 36 GlueAccessibility(); |
| 36 ~GlueAccessibility(); | 37 ~GlueAccessibility(); |
| 37 | 38 |
| 38 // Retrieves the IAccessible information as requested in in_params, by calling | 39 // Retrieves the IAccessible information as requested in in_params, by calling |
| 39 // into WebKit's implementation of IAccessible. Maintains a hashmap of the | 40 // into WebKit's implementation of IAccessible. Maintains a hashmap of the |
| 40 // currently active (browser ref count not zero) IAccessibles. Returns true if | 41 // currently active (browser ref count not zero) IAccessibles. Returns true if |
| 41 // successful, false otherwise. | 42 // successful, false otherwise. |
| 42 bool GetAccessibilityInfo(WebView* view, | 43 bool GetAccessibilityInfo(WebView* view, |
| 43 const ViewMsg_Accessibility_In_Params& in_params, | 44 const AccessibilityInParams& in_params, |
| 44 ViewHostMsg_Accessibility_Out_Params* out_params); | 45 AccessibilityOutParams* out_params); |
| 45 | 46 |
| 46 // Erases the entry identified by the |iaccessible_id| from the hash map. If | 47 // Erases the entry identified by the |iaccessible_id| from the hash map. If |
| 47 // |clear_all| is true, all entries are erased. Returns true if successful, | 48 // |clear_all| is true, all entries are erased. Returns true if successful, |
| 48 // false otherwise. | 49 // false otherwise. |
| 49 bool ClearIAccessibleMap(int iaccessible_id, bool clear_all); | 50 bool ClearIAccessibleMap(int iaccessible_id, bool clear_all); |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 // Retrieves the RenderObject associated with this WebView, and uses it to | 53 // Retrieves the RenderObject associated with this WebView, and uses it to |
| 53 // initialize the root of the render-side MSAA tree with the associated | 54 // initialize the root of the render-side MSAA tree with the associated |
| 54 // accessibility information. Returns true if successful, false otherwise. | 55 // accessibility information. Returns true if successful, false otherwise. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 67 // duplicate entries are not created in the IntToIAccessibleMap (above). | 68 // duplicate entries are not created in the IntToIAccessibleMap (above). |
| 68 IAccessibleToIntMap iaccessible_to_int_map_; | 69 IAccessibleToIntMap iaccessible_to_int_map_; |
| 69 | 70 |
| 70 // Unique identifier for retrieving an IAccessible from the page's hashmap. | 71 // Unique identifier for retrieving an IAccessible from the page's hashmap. |
| 71 int iaccessible_id_; | 72 int iaccessible_id_; |
| 72 | 73 |
| 73 DISALLOW_COPY_AND_ASSIGN(GlueAccessibility); | 74 DISALLOW_COPY_AND_ASSIGN(GlueAccessibility); |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 #endif // WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ | 77 #endif // WEBKIT_GLUE_GLUE_ACCESSIBILITY_H_ |
| OLD | NEW |