| 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> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Returns nullptr if there are no children. | 144 // Returns nullptr if there are no children. |
| 145 BrowserAccessibility* InternalDeepestLastChild() const; | 145 BrowserAccessibility* InternalDeepestLastChild() const; |
| 146 | 146 |
| 147 // Returns the bounds of this object in coordinates relative to this frame. | 147 // Returns the bounds of this object in coordinates relative to this frame. |
| 148 gfx::Rect GetFrameBoundsRect() const; | 148 gfx::Rect GetFrameBoundsRect() const; |
| 149 | 149 |
| 150 // Returns the bounds of this object in coordinates relative to the | 150 // Returns the bounds of this object in coordinates relative to the |
| 151 // page (specifically, the top-left corner of the topmost web contents). | 151 // page (specifically, the top-left corner of the topmost web contents). |
| 152 gfx::Rect GetPageBoundsRect() const; | 152 gfx::Rect GetPageBoundsRect() const; |
| 153 | 153 |
| 154 // Returns the bounds of this object in screen coordinates. | |
| 155 gfx::Rect GetScreenBoundsRect() const; | |
| 156 | |
| 157 // Returns the bounds of the given range in coordinates relative to the | 154 // Returns the bounds of the given range in coordinates relative to the |
| 158 // top-left corner of the overall web area. Only valid when the | 155 // top-left corner of the overall web area. Only valid when the |
| 159 // role is WebAXRoleStaticText. | 156 // role is WebAXRoleStaticText. |
| 160 gfx::Rect GetPageBoundsForRange(int start, int len) const; | 157 gfx::Rect GetPageBoundsForRange(int start, int len) const; |
| 161 | 158 |
| 162 // Same as |GetPageBoundsForRange| but in screen coordinates. | 159 // Same as |GetPageBoundsForRange| but in screen coordinates. |
| 163 gfx::Rect GetScreenBoundsForRange(int start, int len) const; | 160 gfx::Rect GetScreenBoundsForRange(int start, int len) const; |
| 164 | 161 |
| 165 // Convert a bounding rectangle from this node's coordinate system | 162 // Convert a bounding rectangle from this node's coordinate system |
| 166 // (which is relative to its nearest scrollable ancestor) to | 163 // (which is relative to its nearest scrollable ancestor) to |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // Gets the text offsets where new lines start. | 363 // Gets the text offsets where new lines start. |
| 367 std::vector<int> GetLineStartOffsets() const; | 364 std::vector<int> GetLineStartOffsets() const; |
| 368 | 365 |
| 369 // AXPlatformNodeDelegate. | 366 // AXPlatformNodeDelegate. |
| 370 const ui::AXNodeData& GetData() const override; | 367 const ui::AXNodeData& GetData() const override; |
| 371 gfx::NativeWindow GetTopLevelWidget() override; | 368 gfx::NativeWindow GetTopLevelWidget() override; |
| 372 gfx::NativeViewAccessible GetParent() override; | 369 gfx::NativeViewAccessible GetParent() override; |
| 373 int GetChildCount() override; | 370 int GetChildCount() override; |
| 374 gfx::NativeViewAccessible ChildAtIndex(int index) override; | 371 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
| 375 gfx::Vector2d GetGlobalCoordinateOffset() override; | 372 gfx::Vector2d GetGlobalCoordinateOffset() override; |
| 373 gfx::Rect GetScreenBoundsRect() const override; |
| 376 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 374 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
| 377 gfx::NativeViewAccessible GetFocus() override; | 375 gfx::NativeViewAccessible GetFocus() override; |
| 378 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 376 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
| 379 bool AccessibilityPerformAction(const ui::AXActionData& data) override; | 377 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
| 380 void DoDefaultAction() override; | 378 void DoDefaultAction() override; |
| 381 | 379 |
| 382 protected: | 380 protected: |
| 383 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; | 381 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; |
| 384 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; | 382 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; |
| 385 | 383 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 413 // bounds, but "virtual" elements in the accessibility tree that don't | 411 // bounds, but "virtual" elements in the accessibility tree that don't |
| 414 // correspond to a layed-out element sometimes don't have bounds. | 412 // correspond to a layed-out element sometimes don't have bounds. |
| 415 void FixEmptyBounds(gfx::RectF* bounds) const; | 413 void FixEmptyBounds(gfx::RectF* bounds) const; |
| 416 | 414 |
| 417 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 415 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 418 }; | 416 }; |
| 419 | 417 |
| 420 } // namespace content | 418 } // namespace content |
| 421 | 419 |
| 422 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 420 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |