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 "ui/accessibility/ax_enums.h" | 8 #include "ui/accessibility/ax_node_data.h" |
9 #include "ui/accessibility/platform/ax_platform_node.h" | |
10 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | |
9 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
10 #include "ui/views/views_export.h" | 12 #include "ui/views/views_export.h" |
11 | 13 |
12 namespace views { | 14 namespace views { |
13 | 15 |
14 class View; | 16 class View; |
15 | 17 |
16 class VIEWS_EXPORT NativeViewAccessibility { | 18 class VIEWS_EXPORT NativeViewAccessibility : public ui::AXPlatformNodeDelegate { |
17 public: | 19 public: |
18 static NativeViewAccessibility* Create(View* view); | 20 static NativeViewAccessibility* Create(View* view); |
19 | 21 |
20 virtual void NotifyAccessibilityEvent( | |
21 ui::AXEvent event_type) {} | |
22 | |
23 virtual gfx::NativeViewAccessible GetNativeObject(); | 22 virtual gfx::NativeViewAccessible GetNativeObject(); |
24 | 23 |
25 // Call Destroy rather than deleting this, because the subclass may | 24 // Call Destroy rather than deleting this, because the subclass may |
26 // use reference counting. | 25 // use reference counting. |
27 virtual void Destroy(); | 26 virtual void Destroy(); |
28 | 27 |
29 // WebViews need to be registered because they implement their own | 28 // WebViews need to be registered because they implement their own |
30 // tree of accessibility objects, and we need to check them when | 29 // tree of accessibility objects, and we need to check them when |
31 // mapping a child id to a NativeViewAccessible. | 30 // mapping a child id to a NativeViewAccessible. |
32 static void RegisterWebView(View* web_view); | 31 static void RegisterWebView(View* web_view); |
33 static void UnregisterWebView(View* web_view); | 32 static void UnregisterWebView(View* web_view); |
34 | 33 |
34 // ui::AXPlatformNodeDelegate | |
35 virtual ui::AXNodeData* GetData() OVERRIDE; | |
36 virtual int GetChildCount() OVERRIDE; | |
37 virtual gfx::NativeViewAccessible ChildAtIndex(int index) OVERRIDE; | |
38 virtual gfx::NativeViewAccessible GetParent() OVERRIDE; | |
39 virtual gfx::Vector2d GetGlobalCoordinateOffset() OVERRIDE; | |
40 virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) OVERRIDE; | |
41 | |
35 protected: | 42 protected: |
36 NativeViewAccessibility(); | 43 NativeViewAccessibility(View* view); |
dmazzoni
2014/07/29 06:35:15
This will break Windows - the constructor has to t
Andre
2014/07/29 21:58:56
Done.
| |
37 virtual ~NativeViewAccessibility(); | 44 virtual ~NativeViewAccessibility(); |
38 | 45 |
39 private: | 46 private: |
47 View* view_; // Weak. Owns this. | |
48 scoped_ptr<ui::AXPlatformNode> ax_node_; | |
49 ui::AXNodeData data_; | |
50 | |
40 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); | 51 DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility); |
41 }; | 52 }; |
42 | 53 |
43 } // namespace views | 54 } // namespace views |
44 | 55 |
45 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ | 56 #endif // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_ |
OLD | NEW |