OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_FAKE_CARET_WIN_H_ |
| 6 #define UI_ACCESSIBILITY_PLATFORM_AX_FAKE_CARET_WIN_H_ |
| 7 |
| 8 #include <oleacc.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/win/scoped_comptr.h" |
| 12 #include "ui/accessibility/ax_export.h" |
| 13 #include "ui/accessibility/ax_node_data.h" |
| 14 #include "ui/accessibility/ax_tree_data.h" |
| 15 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 16 #include "ui/gfx/geometry/rect.h" |
| 17 #include "ui/gfx/native_widget_types.h" |
| 18 |
| 19 namespace ui { |
| 20 |
| 21 class AXPlatformNodeWin; |
| 22 |
| 23 // A class representing the position of the caret to assistive software on |
| 24 // Windows. This is required because Chrome doesn't use the standard system |
| 25 // caret and because some assistive software still relies on specific |
| 26 // accessibility APIs to retrieve the caret position. |
| 27 class AX_EXPORT AXFakeCaretWin : private AXPlatformNodeDelegate { |
| 28 public: |
| 29 AXFakeCaretWin(gfx::AcceleratedWidget event_target); |
| 30 virtual ~AXFakeCaretWin(); |
| 31 |
| 32 base::win::ScopedComPtr<IAccessible> GetCaret() const; |
| 33 void MoveCaretTo(const gfx::Rect& bounds); |
| 34 |
| 35 private: |
| 36 // |AXPlatformNodeDelegate| members. |
| 37 const AXNodeData& GetData() const override; |
| 38 const ui::AXTreeData& GetTreeData() const override; |
| 39 gfx::NativeWindow GetTopLevelWidget() override; |
| 40 gfx::NativeViewAccessible GetParent() override; |
| 41 int GetChildCount() override; |
| 42 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
| 43 gfx::Rect GetScreenBoundsRect() const override; |
| 44 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
| 45 gfx::NativeViewAccessible GetFocus() override; |
| 46 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
| 47 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
| 48 bool ShouldIgnoreHoveredStateForTesting() override; |
| 49 |
| 50 AXPlatformNodeWin* caret_; |
| 51 gfx::AcceleratedWidget event_target_; |
| 52 AXNodeData data_; |
| 53 |
| 54 friend class AXPlatformNodeWin; |
| 55 DISALLOW_COPY_AND_ASSIGN(AXFakeCaretWin); |
| 56 }; |
| 57 |
| 58 } // namespace ui |
| 59 |
| 60 #endif // UI_ACCESSIBILITY_PLATFORM_AX_FAKE_CARET_WIN_H_ |
OLD | NEW |