OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ | 5 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ |
6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ | 6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ui/accessibility/ax_enums.h" | 9 #include "ui/accessibility/ax_enums.h" |
10 #include "ui/accessibility/ax_export.h" | 10 #include "ui/accessibility/ax_export.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 // Create an appropriate platform-specific instance. The delegate owns the | 24 // Create an appropriate platform-specific instance. The delegate owns the |
25 // AXPlatformNode instance (or manages its lifecycle in some other way). | 25 // AXPlatformNode instance (or manages its lifecycle in some other way). |
26 static AXPlatformNode* Create(AXPlatformNodeDelegate* delegate); | 26 static AXPlatformNode* Create(AXPlatformNodeDelegate* delegate); |
27 | 27 |
28 // Cast a gfx::NativeViewAccessible to an AXPlatformNode if it is one, | 28 // Cast a gfx::NativeViewAccessible to an AXPlatformNode if it is one, |
29 // or return NULL if it's not an instance of this class. | 29 // or return NULL if it's not an instance of this class. |
30 static AXPlatformNode* FromNativeViewAccessible( | 30 static AXPlatformNode* FromNativeViewAccessible( |
31 gfx::NativeViewAccessible accessible); | 31 gfx::NativeViewAccessible accessible); |
32 | 32 |
| 33 // Return the node with the given unique id. |
| 34 static AXPlatformNode* GetFromUniqueId(int32_t unique_id); |
| 35 |
33 // Call Destroy rather than deleting this, because the subclass may | 36 // Call Destroy rather than deleting this, because the subclass may |
34 // use reference counting. | 37 // use reference counting. |
35 virtual void Destroy(); | 38 virtual void Destroy(); |
36 | 39 |
37 // Get the platform-specific accessible object type for this instance. | 40 // Get the platform-specific accessible object type for this instance. |
38 // On some platforms this is just a type cast, on others it may be a | 41 // On some platforms this is just a type cast, on others it may be a |
39 // wrapper object or handle. | 42 // wrapper object or handle. |
40 virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; | 43 virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; |
41 | 44 |
42 // Fire a platform-specific notification that an event has occurred on | 45 // Fire a platform-specific notification that an event has occurred on |
43 // this object. | 46 // this object. |
44 virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0; | 47 virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0; |
45 | 48 |
46 // Return this object's delegate. | 49 // Return this object's delegate. |
47 virtual AXPlatformNodeDelegate* GetDelegate() const = 0; | 50 virtual AXPlatformNodeDelegate* GetDelegate() const = 0; |
48 | 51 |
49 protected: | 52 protected: |
50 AXPlatformNode(); | 53 AXPlatformNode(); |
51 virtual ~AXPlatformNode(); | 54 virtual ~AXPlatformNode(); |
52 | 55 |
53 virtual AXPlatformNode* GetFromUniqueId(int32_t unique_id); | 56 virtual int32_t unique_id() const; |
54 | 57 |
| 58 private: |
55 int32_t unique_id_; | 59 int32_t unique_id_; |
56 }; | 60 }; |
57 | 61 |
58 } // namespace ui | 62 } // namespace ui |
59 | 63 |
60 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ | 64 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_H_ |
OLD | NEW |