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