OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_IMPL_H_ |
| 7 |
| 8 #include "base/hash_tables.h" |
| 9 #include "webkit/glue/webaccessibilitymanager.h" |
| 10 |
| 11 class GlueAccessibilityObject; |
| 12 |
| 13 namespace webkit_glue { |
| 14 typedef base::hash_map<int, GlueAccessibilityObject*> IntToAccObjMap; |
| 15 typedef base::hash_map<GlueAccessibilityObject*, int> AccObjToIntMap; |
| 16 |
| 17 //////////////////////////////////////////////////////////////////////////////// |
| 18 // |
| 19 // WebAccessibilityManagerImpl |
| 20 // |
| 21 // |
| 22 // Implements WebAccessibilityManager. |
| 23 // Responds to incoming accessibility requests from the browser side. Retrieves |
| 24 // the requested information from the active AccessibilityObject, through the |
| 25 // GlueAccessibilityObject. |
| 26 //////////////////////////////////////////////////////////////////////////////// |
| 27 class WebAccessibilityManagerImpl : public WebAccessibilityManager { |
| 28 public: |
| 29 // From WebAccessibilityManager. |
| 30 bool GetAccObjInfo(WebView* view, const WebAccessibility::InParams& in_params, |
| 31 WebAccessibility::OutParams* out_params); |
| 32 |
| 33 // From WebAccessibilityManager. |
| 34 bool ClearAccObjMap(int acc_obj_id, bool clear_all); |
| 35 |
| 36 protected: |
| 37 // Needed so WebAccessibilityManager::Create can call our constructor. |
| 38 friend class WebAccessibilityManager; |
| 39 |
| 40 WebAccessibilityManagerImpl(); |
| 41 ~WebAccessibilityManagerImpl() {} |
| 42 |
| 43 private: |
| 44 // From WebAccessibilityManager. |
| 45 bool InitAccObjRoot(WebView* view); |
| 46 |
| 47 // Wrapper around the pointer that holds the root of the AccessibilityObject |
| 48 // tree, to allow the use of a scoped_refptr. |
| 49 struct GlueAccessibilityObjectRoot; |
| 50 GlueAccessibilityObjectRoot* root_; |
| 51 |
| 52 // Hashmap for cashing of elements in use by the AT, mapping id (int) to a |
| 53 // GlueAccessibilityObject pointer. |
| 54 IntToAccObjMap int_to_acc_obj_map_; |
| 55 // Hashmap for cashing of elements in use by the AT, mapping a |
| 56 // GlueAccessibilityObject pointer to its id (int). Needed for reverse lookup, |
| 57 // to ensure unnecessary duplicate entries are not created in the |
| 58 // IntToAccObjMap (above). |
| 59 AccObjToIntMap acc_obj_to_int_map_; |
| 60 |
| 61 // Unique identifier for retrieving a GlueAccessibilityObject from the page's |
| 62 // hashmaps. |
| 63 int acc_obj_id_; |
| 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(WebAccessibilityManagerImpl); |
| 66 }; |
| 67 |
| 68 }; // namespace webkit_glue |
| 69 |
| 70 #endif // WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_IMPL_H_ |
OLD | NEW |