OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "webkit/glue/webaccessibility.h" | 16 #include "webkit/glue/webaccessibility.h" |
17 | 17 |
18 class BrowserAccessibilityManager; | 18 class BrowserAccessibilityManager; |
19 #if defined(OS_MACOSX) && __OBJC__ | 19 #if defined(OS_MACOSX) && __OBJC__ |
20 @class BrowserAccessibilityCocoa; | 20 @class BrowserAccessibilityCocoa; |
21 #elif defined(OS_WIN) | 21 #elif defined(OS_WIN) |
22 class BrowserAccessibilityWin; | 22 class BrowserAccessibilityWin; |
23 #elif defined(TOOLKIT_GTK) | |
24 class BrowserAccessibilityGtk; | |
25 #endif | 23 #endif |
26 | 24 |
27 using webkit_glue::WebAccessibility; | 25 using webkit_glue::WebAccessibility; |
28 typedef std::map<WebAccessibility::BoolAttribute, bool> BoolAttrMap; | 26 typedef std::map<WebAccessibility::BoolAttribute, bool> BoolAttrMap; |
29 typedef std::map<WebAccessibility::FloatAttribute, float> FloatAttrMap; | 27 typedef std::map<WebAccessibility::FloatAttribute, float> FloatAttrMap; |
30 typedef std::map<WebAccessibility::IntAttribute, int> IntAttrMap; | 28 typedef std::map<WebAccessibility::IntAttribute, int> IntAttrMap; |
31 typedef std::map<WebAccessibility::StringAttribute, string16> StringAttrMap; | 29 typedef std::map<WebAccessibility::StringAttribute, string16> StringAttrMap; |
32 | 30 |
33 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
34 // | 32 // |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 const string16& name() const { return name_; } | 181 const string16& name() const { return name_; } |
184 int32 renderer_id() const { return renderer_id_; } | 182 int32 renderer_id() const { return renderer_id_; } |
185 int32 role() const { return role_; } | 183 int32 role() const { return role_; } |
186 const string16& role_name() const { return role_name_; } | 184 const string16& role_name() const { return role_name_; } |
187 int32 state() const { return state_; } | 185 int32 state() const { return state_; } |
188 const string16& value() const { return value_; } | 186 const string16& value() const { return value_; } |
189 bool instance_active() const { return instance_active_; } | 187 bool instance_active() const { return instance_active_; } |
190 int32 ref_count() const { return ref_count_; } | 188 int32 ref_count() const { return ref_count_; } |
191 | 189 |
192 #if defined(OS_MACOSX) && __OBJC__ | 190 #if defined(OS_MACOSX) && __OBJC__ |
193 BrowserAccessibilityCocoa* ToBrowserAccessibilityCocoa(); | 191 BrowserAccessibilityCocoa* toBrowserAccessibilityCocoa(); |
194 #elif defined(OS_WIN) | 192 #elif defined(OS_WIN) |
195 BrowserAccessibilityWin* ToBrowserAccessibilityWin(); | 193 BrowserAccessibilityWin* toBrowserAccessibilityWin(); |
196 #elif defined(TOOLKIT_GTK) | |
197 BrowserAccessibilityGtk* ToBrowserAccessibilityGtk(); | |
198 #endif | 194 #endif |
199 | 195 |
200 // Retrieve the value of a bool attribute from the bool attribute | 196 // Retrieve the value of a bool attribute from the bool attribute |
201 // map and returns true if found. | 197 // map and returns true if found. |
202 bool GetBoolAttribute(WebAccessibility::BoolAttribute attr, bool* value) | 198 bool GetBoolAttribute(WebAccessibility::BoolAttribute attr, bool* value) |
203 const; | 199 const; |
204 | 200 |
205 // Retrieve the value of a float attribute from the float attribute | 201 // Retrieve the value of a float attribute from the float attribute |
206 // map and returns true if found. | 202 // map and returns true if found. |
207 bool GetFloatAttribute(WebAccessibility::FloatAttribute attr, float* value) | 203 bool GetFloatAttribute(WebAccessibility::FloatAttribute attr, float* value) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // tree, a client may still be holding onto a pointer to this object, so | 295 // tree, a client may still be holding onto a pointer to this object, so |
300 // we mark it as inactive so that calls to any of this object's methods | 296 // we mark it as inactive so that calls to any of this object's methods |
301 // immediately return failure. | 297 // immediately return failure. |
302 bool instance_active_; | 298 bool instance_active_; |
303 | 299 |
304 private: | 300 private: |
305 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 301 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
306 }; | 302 }; |
307 | 303 |
308 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 304 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |