| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "third_party/WebKit/public/web/WebAXEnums.h" | 19 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 20 #include "ui/accessibility/ax_node.h" | 20 #include "ui/accessibility/ax_node.h" |
| 21 #include "ui/accessibility/ax_node_data.h" | 21 #include "ui/accessibility/ax_node_data.h" |
| 22 #include "ui/accessibility/ax_position.h" |
| 22 #include "ui/accessibility/ax_text_utils.h" | 23 #include "ui/accessibility/ax_text_utils.h" |
| 23 | 24 |
| 24 // Set PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL if this platform has | 25 // Set PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL if this platform has |
| 25 // a platform-specific subclass of BrowserAccessibility and | 26 // a platform-specific subclass of BrowserAccessibility and |
| 26 // BrowserAccessibilityManager. | 27 // BrowserAccessibilityManager. |
| 27 #undef PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL | 28 #undef PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL |
| 28 | 29 |
| 29 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 30 #define PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL 1 | 31 #define PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL 1 |
| 31 #endif | 32 #endif |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 // tree on the browser side. It exactly corresponds to one WebAXObject from | 63 // tree on the browser side. It exactly corresponds to one WebAXObject from |
| 63 // Blink. It's owned by a BrowserAccessibilityManager. | 64 // Blink. It's owned by a BrowserAccessibilityManager. |
| 64 // | 65 // |
| 65 // There are subclasses of BrowserAccessibility for each platform where | 66 // There are subclasses of BrowserAccessibility for each platform where |
| 66 // we implement native accessibility APIs. This base class is used occasionally | 67 // we implement native accessibility APIs. This base class is used occasionally |
| 67 // for tests. | 68 // for tests. |
| 68 // | 69 // |
| 69 //////////////////////////////////////////////////////////////////////////////// | 70 //////////////////////////////////////////////////////////////////////////////// |
| 70 class CONTENT_EXPORT BrowserAccessibility { | 71 class CONTENT_EXPORT BrowserAccessibility { |
| 71 public: | 72 public: |
| 73 using AXPosition = ui::AXPosition<BrowserAccessibility>; |
| 74 |
| 72 // Creates a platform specific BrowserAccessibility. Ownership passes to the | 75 // Creates a platform specific BrowserAccessibility. Ownership passes to the |
| 73 // caller. | 76 // caller. |
| 74 static BrowserAccessibility* Create(); | 77 static BrowserAccessibility* Create(); |
| 75 | 78 |
| 76 virtual ~BrowserAccessibility(); | 79 virtual ~BrowserAccessibility(); |
| 77 | 80 |
| 78 static BrowserAccessibility* GetFromUniqueID(int32_t unique_id); | 81 static BrowserAccessibility* GetFromUniqueID(int32_t unique_id); |
| 79 | 82 |
| 80 // Called only once, immediately after construction. The constructor doesn't | 83 // Called only once, immediately after construction. The constructor doesn't |
| 81 // take any arguments because in the Windows subclass we use a special | 84 // take any arguments because in the Windows subclass we use a special |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // page coordinates (when |frameOnly| is false), or in frame coordinates | 377 // page coordinates (when |frameOnly| is false), or in frame coordinates |
| 375 // (when |frameOnly| is true). | 378 // (when |frameOnly| is true). |
| 376 gfx::Rect RelativeToAbsoluteBounds(gfx::RectF bounds, bool frame_only) const; | 379 gfx::Rect RelativeToAbsoluteBounds(gfx::RectF bounds, bool frame_only) const; |
| 377 | 380 |
| 378 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 381 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 379 }; | 382 }; |
| 380 | 383 |
| 381 } // namespace content | 384 } // namespace content |
| 382 | 385 |
| 383 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 386 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |