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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 409 |
413 // Gets the text offsets where new lines start. | 410 // Gets the text offsets where new lines start. |
414 std::vector<int> GetLineStartOffsets() const; | 411 std::vector<int> GetLineStartOffsets() const; |
415 | 412 |
416 // AXPlatformNodeDelegate. | 413 // AXPlatformNodeDelegate. |
417 const ui::AXNodeData& GetData() const override; | 414 const ui::AXNodeData& GetData() const override; |
418 gfx::NativeWindow GetTopLevelWidget() override; | 415 gfx::NativeWindow GetTopLevelWidget() override; |
419 gfx::NativeViewAccessible GetParent() override; | 416 gfx::NativeViewAccessible GetParent() override; |
420 int GetChildCount() override; | 417 int GetChildCount() override; |
421 gfx::NativeViewAccessible ChildAtIndex(int index) override; | 418 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
422 gfx::Vector2d GetGlobalCoordinateOffset() override; | 419 gfx::Rect GetScreenBoundsRect() const override; |
423 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 420 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
424 gfx::NativeViewAccessible GetFocus() override; | 421 gfx::NativeViewAccessible GetFocus() override; |
425 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 422 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
426 bool AccessibilityPerformAction(const ui::AXActionData& data) override; | 423 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
427 | 424 |
428 protected: | 425 protected: |
429 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; | 426 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; |
430 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; | 427 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; |
431 | 428 |
432 BrowserAccessibility(); | 429 BrowserAccessibility(); |
(...skipping 26 matching lines...) Expand all Loading... |
459 // bounds, but "virtual" elements in the accessibility tree that don't | 456 // bounds, but "virtual" elements in the accessibility tree that don't |
460 // correspond to a layed-out element sometimes don't have bounds. | 457 // correspond to a layed-out element sometimes don't have bounds. |
461 void FixEmptyBounds(gfx::RectF* bounds) const; | 458 void FixEmptyBounds(gfx::RectF* bounds) const; |
462 | 459 |
463 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 460 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
464 }; | 461 }; |
465 | 462 |
466 } // namespace content | 463 } // namespace content |
467 | 464 |
468 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 465 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |