| 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_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 static NativeViewAccessibility* Create(View* view); | 38 static NativeViewAccessibility* Create(View* view); |
| 39 | 39 |
| 40 gfx::NativeViewAccessible GetNativeObject(); | 40 gfx::NativeViewAccessible GetNativeObject(); |
| 41 | 41 |
| 42 // Call Destroy rather than deleting this, because the subclass may | 42 // Call Destroy rather than deleting this, because the subclass may |
| 43 // use reference counting. | 43 // use reference counting. |
| 44 virtual void Destroy(); | 44 virtual void Destroy(); |
| 45 | 45 |
| 46 void NotifyAccessibilityEvent(ui::AXEvent event_type); | 46 void NotifyAccessibilityEvent(ui::AXEvent event_type); |
| 47 | 47 |
| 48 // ui::AXPlatformNodeDelegate | 48 // ui::AXPlatformNodeDelegate: |
| 49 const ui::AXNodeData& GetData() override; | 49 const ui::AXNodeData& GetData() override; |
| 50 int GetChildCount() override; | 50 int GetChildCount() override; |
| 51 gfx::NativeViewAccessible ChildAtIndex(int index) override; | 51 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
| 52 gfx::NativeWindow GetTopLevelWidget() override; | 52 gfx::NativeWindow GetTopLevelWidget() override; |
| 53 gfx::NativeViewAccessible GetParent() override; | 53 gfx::NativeViewAccessible GetParent() override; |
| 54 gfx::Vector2d GetGlobalCoordinateOffset() override; | 54 gfx::Vector2d GetGlobalCoordinateOffset() override; |
| 55 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 55 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
| 56 gfx::NativeViewAccessible GetFocus() override; | 56 gfx::NativeViewAccessible GetFocus() override; |
| 57 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 57 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
| 58 void DoDefaultAction() override; | 58 void DoDefaultAction() override; |
| 59 bool SetStringValue(const base::string16& new_value) override; | 59 bool SetStringValue(const base::string16& new_value) override; |
| 60 bool CanSetStringValue() override; | 60 bool CanSetStringValue() override; |
| 61 bool IsIgnored() override; |
| 61 | 62 |
| 62 // WidgetObserver | 63 // WidgetObserver: |
| 63 void OnWidgetDestroying(Widget* widget) override; | 64 void OnWidgetDestroying(Widget* widget) override; |
| 64 | 65 |
| 65 Widget* parent_widget() const { return parent_widget_; } | 66 Widget* parent_widget() const { return parent_widget_; } |
| 66 void SetParentWidget(Widget* parent_widget); | 67 void SetParentWidget(Widget* parent_widget); |
| 67 | 68 |
| 69 // Whether the accessibility element has any unignored children. |
| 70 bool IsLeafElement(); |
| 71 |
| 68 protected: | 72 protected: |
| 69 NativeViewAccessibility(View* view); | 73 NativeViewAccessibility(View* view); |
| 70 ~NativeViewAccessibility() override; | 74 ~NativeViewAccessibility() override; |
| 71 | 75 |
| 72 // Weak. Owns this. | 76 // Weak. Owns this. |
| 73 View* view_; | 77 View* view_; |
| 74 | 78 |
| 75 // Weak. Uses WidgetObserver to clear. This is set on the root view for | 79 // Weak. Uses WidgetObserver to clear. This is set on the root view for |
| 76 // a widget that's owned by another widget, so we can walk back up the | 80 // a widget that's owned by another widget, so we can walk back up the |
| 77 // tree. | 81 // tree. |
| 78 Widget* parent_widget_; | 82 Widget* parent_widget_; |
| 79 | 83 |
| 80 private: | 84 private: |
| 81 void PopulateChildWidgetVector(std::vector<Widget*>* result_child_widgets); | 85 void PopulateChildWidgetVector(std::vector<Widget*>* result_child_widgets); |
| 82 | 86 |
| 83 // We own this, but it is reference-counted on some platforms so we can't use | 87 // We own this, but it is reference-counted on some platforms so we can't use |
| 84 // a scoped_ptr. It is dereferenced in the destructor. | 88 // a scoped_ptr. It is dereferenced in the destructor. |
| 85 ui::AXPlatformNode* ax_node_; | 89 ui::AXPlatformNode* ax_node_; |
| 86 | 90 |
| 87 ui::AXNodeData data_; | 91 ui::AXNodeData data_; |
| 88 | 92 |
| 89 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); | 93 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 } // namespace views | 96 } // namespace views |
| 93 | 97 |
| 94 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ | 98 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ |
| OLD | NEW |