| 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 if (ViewsDelegate::views_delegate) { |
| 129 scoped_refptr<base::TaskRunner> init_task_runner = |
| 130 ViewsDelegate::views_delegate-> |
| 131 GetTaskRunnerForAuraLinuxAccessibilityInit(); |
| 132 if (init_task_runner) |
| 133 ui::AXPlatformNodeAuraLinux::StaticInitialize(init_task_runner); |
| 134 } |
| 128 } | 135 } |
| 129 | 136 |
| 130 ~AuraLinuxApplication() override { | 137 ~AuraLinuxApplication() override { |
| 131 platform_node_->Destroy(); | 138 platform_node_->Destroy(); |
| 132 platform_node_ = nullptr; | 139 platform_node_ = nullptr; |
| 133 } | 140 } |
| 134 | 141 |
| 135 ui::AXPlatformNode* platform_node_; | 142 ui::AXPlatformNode* platform_node_; |
| 136 ui::AXNodeData data_; | 143 ui::AXNodeData data_; |
| 137 std::vector<Widget*> widgets_; | 144 std::vector<Widget*> widgets_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 155 } | 162 } |
| 156 | 163 |
| 157 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { | 164 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { |
| 158 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); | 165 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); |
| 159 if (!parent) | 166 if (!parent) |
| 160 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); | 167 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); |
| 161 return parent; | 168 return parent; |
| 162 } | 169 } |
| 163 | 170 |
| 164 } // namespace views | 171 } // namespace views |
| OLD | NEW |