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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "third_party/WebKit/public/web/WebAXEnums.h" | 17 #include "third_party/WebKit/public/web/WebAXEnums.h" |
18 #include "ui/accessibility/ax_node.h" | 18 #include "ui/accessibility/ax_node.h" |
19 #include "ui/accessibility/ax_node_data.h" | 19 #include "ui/accessibility/ax_node_data.h" |
20 #include "ui/accessibility/ax_text_utils.h" | 20 #include "ui/accessibility/ax_text_utils.h" |
21 | 21 |
22 #if defined(OS_MACOSX) && __OBJC__ | 22 #if defined(OS_MACOSX) && __OBJC__ |
23 @class BrowserAccessibilityCocoa; | 23 @class BrowserAccessibilityCocoa; |
24 #endif | 24 #endif |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class BrowserAccessibilityManager; | 27 class BrowserAccessibilityManager; |
28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
29 class BrowserAccessibilityWin; | 29 class BrowserAccessibilityWin; |
| 30 #elif(defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 31 class BrowserAccessibilityAuraLinux; |
30 #endif | 32 #endif |
31 | 33 |
32 //////////////////////////////////////////////////////////////////////////////// | 34 //////////////////////////////////////////////////////////////////////////////// |
33 // | 35 // |
34 // BrowserAccessibility | 36 // BrowserAccessibility |
35 // | 37 // |
36 // A BrowserAccessibility object represents one node in the accessibility | 38 // A BrowserAccessibility object represents one node in the accessibility |
37 // tree on the browser side. It exactly corresponds to one WebAXObject from | 39 // tree on the browser side. It exactly corresponds to one WebAXObject from |
38 // Blink. It's owned by a BrowserAccessibilityManager. | 40 // Blink. It's owned by a BrowserAccessibilityManager. |
39 // | 41 // |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 177 |
176 // Returns true if this is a native platform-specific object, vs a | 178 // Returns true if this is a native platform-specific object, vs a |
177 // cross-platform generic object. Don't call ToBrowserAccessibilityXXX if | 179 // cross-platform generic object. Don't call ToBrowserAccessibilityXXX if |
178 // IsNative returns false. | 180 // IsNative returns false. |
179 virtual bool IsNative() const; | 181 virtual bool IsNative() const; |
180 | 182 |
181 #if defined(OS_MACOSX) && __OBJC__ | 183 #if defined(OS_MACOSX) && __OBJC__ |
182 BrowserAccessibilityCocoa* ToBrowserAccessibilityCocoa(); | 184 BrowserAccessibilityCocoa* ToBrowserAccessibilityCocoa(); |
183 #elif defined(OS_WIN) | 185 #elif defined(OS_WIN) |
184 BrowserAccessibilityWin* ToBrowserAccessibilityWin(); | 186 BrowserAccessibilityWin* ToBrowserAccessibilityWin(); |
| 187 #elif(defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 188 BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux(); |
185 #endif | 189 #endif |
186 | 190 |
187 // Accessing accessibility attributes: | 191 // Accessing accessibility attributes: |
188 // | 192 // |
189 // There are dozens of possible attributes for an accessibility node, | 193 // There are dozens of possible attributes for an accessibility node, |
190 // but only a few tend to apply to any one object, so we store them | 194 // but only a few tend to apply to any one object, so we store them |
191 // in sparse arrays of <attribute id, attribute value> pairs, organized | 195 // in sparse arrays of <attribute id, attribute value> pairs, organized |
192 // by type (bool, int, float, string, int list). | 196 // by type (bool, int, float, string, int list). |
193 // | 197 // |
194 // There are three accessors for each type of attribute: one that returns | 198 // There are three accessors for each type of attribute: one that returns |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // its nearest scrollable ancestor) to local bounds (which are relative | 297 // its nearest scrollable ancestor) to local bounds (which are relative |
294 // to the top of the web accessibility tree). | 298 // to the top of the web accessibility tree). |
295 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; | 299 gfx::Rect ElementBoundsToLocalBounds(gfx::Rect bounds) const; |
296 | 300 |
297 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 301 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
298 }; | 302 }; |
299 | 303 |
300 } // namespace content | 304 } // namespace content |
301 | 305 |
302 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 306 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |