| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ | 5 #ifndef UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ |
| 6 #define UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ | 6 #define UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/accessibility/ax_action_data.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 11 #include "ui/accessibility/ax_node_data.h" |
| 11 #include "ui/accessibility/platform/ax_platform_node.h" | 12 #include "ui/accessibility/platform/ax_platform_node.h" |
| 12 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | 13 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 14 #include "ui/views/views_export.h" | 15 #include "ui/views/views_export.h" |
| 15 #include "ui/views/widget/widget_observer.h" | 16 #include "ui/views/widget/widget_observer.h" |
| 16 | 17 |
| 17 // Set PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL if this platform has a | 18 // Set PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL if this platform has a |
| 18 // specific implementation of NativeViewAccessibility::Create(). | 19 // specific implementation of NativeViewAccessibility::Create(). |
| 19 #undef PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL | 20 #undef PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 static NativeViewAccessibility* Create(View* view); | 39 static NativeViewAccessibility* Create(View* view); |
| 39 | 40 |
| 40 gfx::NativeViewAccessible GetNativeObject(); | 41 gfx::NativeViewAccessible GetNativeObject(); |
| 41 | 42 |
| 42 // Call Destroy rather than deleting this, because the subclass may | 43 // Call Destroy rather than deleting this, because the subclass may |
| 43 // use reference counting. | 44 // use reference counting. |
| 44 virtual void Destroy(); | 45 virtual void Destroy(); |
| 45 | 46 |
| 46 void NotifyAccessibilityEvent(ui::AXEvent event_type); | 47 void NotifyAccessibilityEvent(ui::AXEvent event_type); |
| 47 | 48 |
| 49 // Focuses or unfocuses a View. |
| 50 bool SetFocused(bool focused); |
| 51 |
| 48 // ui::AXPlatformNodeDelegate | 52 // ui::AXPlatformNodeDelegate |
| 49 const ui::AXNodeData& GetData() override; | 53 const ui::AXNodeData& GetData() override; |
| 50 int GetChildCount() override; | 54 int GetChildCount() override; |
| 51 gfx::NativeViewAccessible ChildAtIndex(int index) override; | 55 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
| 52 gfx::NativeWindow GetTopLevelWidget() override; | 56 gfx::NativeWindow GetTopLevelWidget() override; |
| 53 gfx::NativeViewAccessible GetParent() override; | 57 gfx::NativeViewAccessible GetParent() override; |
| 54 gfx::Vector2d GetGlobalCoordinateOffset() override; | 58 gfx::Vector2d GetGlobalCoordinateOffset() override; |
| 55 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 59 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
| 56 gfx::NativeViewAccessible GetFocus() override; | 60 gfx::NativeViewAccessible GetFocus() override; |
| 57 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 61 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
| 62 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
| 58 void DoDefaultAction() override; | 63 void DoDefaultAction() override; |
| 59 bool SetStringValue(const base::string16& new_value, | |
| 60 bool clear_first) override; | |
| 61 bool CanSetStringValue() override; | |
| 62 bool SetFocused(bool focused) override; | |
| 63 | 64 |
| 64 // WidgetObserver | 65 // WidgetObserver |
| 65 void OnWidgetDestroying(Widget* widget) override; | 66 void OnWidgetDestroying(Widget* widget) override; |
| 66 | 67 |
| 67 Widget* parent_widget() const { return parent_widget_; } | 68 Widget* parent_widget() const { return parent_widget_; } |
| 68 void SetParentWidget(Widget* parent_widget); | 69 void SetParentWidget(Widget* parent_widget); |
| 69 | 70 |
| 70 protected: | 71 protected: |
| 71 NativeViewAccessibility(View* view); | 72 NativeViewAccessibility(View* view); |
| 72 ~NativeViewAccessibility() override; | 73 ~NativeViewAccessibility() override; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 87 ui::AXPlatformNode* ax_node_; | 88 ui::AXPlatformNode* ax_node_; |
| 88 | 89 |
| 89 ui::AXNodeData data_; | 90 ui::AXNodeData data_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); | 92 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace views | 95 } // namespace views |
| 95 | 96 |
| 96 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ | 97 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ |
| OLD | NEW |