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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 362 |
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::Rect GetScreenBoundsRect() const override; |
376 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 373 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
377 gfx::NativeViewAccessible GetFocus() override; | 374 gfx::NativeViewAccessible GetFocus() override; |
378 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 375 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
379 bool AccessibilityPerformAction(const ui::AXActionData& data) override; | 376 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
380 void DoDefaultAction() override; | 377 void DoDefaultAction() override; |
381 | 378 |
382 protected: | 379 protected: |
383 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; | 380 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; |
384 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; | 381 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; |
385 | 382 |
(...skipping 27 matching lines...) Expand all Loading... |
413 // bounds, but "virtual" elements in the accessibility tree that don't | 410 // bounds, but "virtual" elements in the accessibility tree that don't |
414 // correspond to a layed-out element sometimes don't have bounds. | 411 // correspond to a layed-out element sometimes don't have bounds. |
415 void FixEmptyBounds(gfx::RectF* bounds) const; | 412 void FixEmptyBounds(gfx::RectF* bounds) const; |
416 | 413 |
417 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 414 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
418 }; | 415 }; |
419 | 416 |
420 } // namespace content | 417 } // namespace content |
421 | 418 |
422 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 419 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |