OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ui/views/accessibility/native_view_accessibility_auralinux.h" | 5 #include "ui/views/accessibility/native_view_accessibility_auralinux.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 AuraLinuxApplication() | 119 AuraLinuxApplication() |
120 : platform_node_(ui::AXPlatformNode::Create(this)) { | 120 : platform_node_(ui::AXPlatformNode::Create(this)) { |
121 data_.role = ui::AX_ROLE_APPLICATION; | 121 data_.role = ui::AX_ROLE_APPLICATION; |
122 if (ViewsDelegate::views_delegate) { | 122 if (ViewsDelegate::views_delegate) { |
123 data_.AddStringAttribute( | 123 data_.AddStringAttribute( |
124 ui::AX_ATTR_NAME, | 124 ui::AX_ATTR_NAME, |
125 ViewsDelegate::views_delegate->GetApplicationName()); | 125 ViewsDelegate::views_delegate->GetApplicationName()); |
126 } | 126 } |
127 ui::AXPlatformNodeAuraLinux::SetApplication(platform_node_); | 127 ui::AXPlatformNodeAuraLinux::SetApplication(platform_node_); |
| 128 scoped_refptr<base::TaskRunner> init_task_runner = |
| 129 ViewsDelegate::views_delegate->GetInitializationTaskRunner(); |
| 130 if (init_task_runner) |
| 131 ui::AXPlatformNodeAuraLinux::StaticInitialize(init_task_runner); |
128 } | 132 } |
129 | 133 |
130 ~AuraLinuxApplication() override { | 134 ~AuraLinuxApplication() override { |
131 platform_node_->Destroy(); | 135 platform_node_->Destroy(); |
132 platform_node_ = nullptr; | 136 platform_node_ = nullptr; |
133 } | 137 } |
134 | 138 |
135 ui::AXPlatformNode* platform_node_; | 139 ui::AXPlatformNode* platform_node_; |
136 ui::AXNodeData data_; | 140 ui::AXNodeData data_; |
137 std::vector<Widget*> widgets_; | 141 std::vector<Widget*> widgets_; |
(...skipping 17 matching lines...) Expand all Loading... |
155 } | 159 } |
156 | 160 |
157 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { | 161 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { |
158 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); | 162 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); |
159 if (!parent) | 163 if (!parent) |
160 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); | 164 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); |
161 return parent; | 165 return parent; |
162 } | 166 } |
163 | 167 |
164 } // namespace views | 168 } // namespace views |
OLD | NEW |