| 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_WEBACCESSIBILITYMANAGER_H_ | 5 #ifndef WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_ |
| 6 #define WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_ | 6 #define WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_ |
| 7 | 7 |
| 8 #include "webkit/glue/webaccessibility.h" | 8 #include "webkit/glue/webaccessibility.h" |
| 9 | 9 |
| 10 namespace WebCore { |
| 11 class AccessibilityObject; |
| 12 } |
| 13 |
| 10 class WebView; | 14 class WebView; |
| 11 | 15 |
| 12 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 13 // | 17 // |
| 14 // WebAccessibilityManager | 18 // WebAccessibilityManager |
| 15 // | 19 // |
| 16 // Responds to incoming accessibility requests from the browser side. Retrieves | 20 // Responds to incoming accessibility requests from the browser side. Retrieves |
| 17 // the requested information from the active AccessibilityObject, through the | 21 // the requested information from the active AccessibilityObject, through the |
| 18 // GlueAccessibilityObject. | 22 // GlueAccessibilityObject. |
| 19 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
| 20 namespace webkit_glue { | 24 namespace webkit_glue { |
| 21 | 25 |
| 22 class WebAccessibilityManager { | 26 class WebAccessibilityManager { |
| 23 public: | 27 public: |
| 24 WebAccessibilityManager() {} | 28 WebAccessibilityManager() {} |
| 25 virtual ~WebAccessibilityManager() {} | 29 virtual ~WebAccessibilityManager() {} |
| 26 | 30 |
| 31 // Creates a new instance of WebAccessibilityManager. |
| 27 static WebAccessibilityManager* Create(); | 32 static WebAccessibilityManager* Create(); |
| 28 | 33 |
| 29 // Retrieves the accessibility information as requested in in_params, by | 34 // Retrieves the accessibility information as requested in in_params, by |
| 30 // calling into WebKit's AccessibilityObject. Maintains a hashmap of the | 35 // calling into WebKit's AccessibilityObject. Maintains a hashmap of the |
| 31 // currently active (browser side ref-count non-zero) instances. Returns true | 36 // currently active (browser side ref-count non-zero) instances. Returns true |
| 32 // if successful, false otherwise. | 37 // if successful, false otherwise. |
| 33 virtual bool GetAccObjInfo(WebView* view, | 38 virtual bool GetAccObjInfo(WebView* view, |
| 34 const WebAccessibility::InParams& in_params, | 39 const WebAccessibility::InParams& in_params, |
| 35 WebAccessibility::OutParams* out_params) = 0; | 40 WebAccessibility::OutParams* out_params) = 0; |
| 36 | 41 |
| 37 // Erases the entry identified by the [acc_obj_id] from the hash maps. If | 42 // Erases the entry identified by the [acc_obj_id] from the hash maps. If |
| 38 // [clear_all] is true, all entries are erased. Returns true if successful, | 43 // [clear_all] is true, all entries are erased. Returns true if successful, |
| 39 // false otherwise. | 44 // false otherwise. |
| 40 virtual bool ClearAccObjMap(int acc_obj_id, bool clear_all) = 0; | 45 virtual bool ClearAccObjMap(int acc_obj_id, bool clear_all) = 0; |
| 41 | 46 |
| 47 // Retrieves the id of the input AccessibilityObject, due to a focus event. |
| 48 // Returns an id greater than or equal to 0 if successful, -1 otherwise. |
| 49 virtual int FocusAccObj(WebCore::AccessibilityObject* acc_obj) = 0; |
| 50 |
| 51 private: |
| 42 // Retrieves the RenderObject associated with this WebView, and uses it to | 52 // Retrieves the RenderObject associated with this WebView, and uses it to |
| 43 // initialize the root of the GlueAccessibilityObject tree with the | 53 // initialize the root of the GlueAccessibilityObject tree with the |
| 44 // associated accessibility information. Returns true if successful, false | 54 // associated accessibility information. Returns true if successful, false |
| 45 // otherwise. | 55 // otherwise. |
| 46 virtual bool InitAccObjRoot(WebView* view) = 0; | 56 virtual bool InitAccObjRoot(WebView* view) = 0; |
| 47 | 57 |
| 48 private: | |
| 49 DISALLOW_COPY_AND_ASSIGN(WebAccessibilityManager); | 58 DISALLOW_COPY_AND_ASSIGN(WebAccessibilityManager); |
| 50 }; | 59 }; |
| 51 | 60 |
| 52 } // namespace webkit_glue | 61 } // namespace webkit_glue |
| 53 | 62 |
| 54 #endif // WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_ | 63 #endif // WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_ |
| OLD | NEW |