Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: ui/views/accessibility/native_view_accessibility_auralinux.cc

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 bool SetStringValue(const base::string16& new_value) override { 112 bool SetStringValue(const base::string16& new_value) override {
113 return false; 113 return false;
114 } 114 }
115 115
116 private: 116 private:
117 friend struct DefaultSingletonTraits<AuraLinuxApplication>; 117 friend struct DefaultSingletonTraits<AuraLinuxApplication>;
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::GetInstance()) {
123 data_.AddStringAttribute( 123 data_.AddStringAttribute(
124 ui::AX_ATTR_NAME, 124 ui::AX_ATTR_NAME,
125 ViewsDelegate::views_delegate->GetApplicationName()); 125 ViewsDelegate::GetInstance()->GetApplicationName());
126 } 126 }
127 ui::AXPlatformNodeAuraLinux::SetApplication(platform_node_); 127 ui::AXPlatformNodeAuraLinux::SetApplication(platform_node_);
128 if (ViewsDelegate::views_delegate) { 128 if (ViewsDelegate::GetInstance()) {
129 // This should be on the a blocking pool thread so that we can open 129 // This should be on the a blocking pool thread so that we can open
130 // libatk-bridge.so without blocking this thread. 130 // libatk-bridge.so without blocking this thread.
131 scoped_refptr<base::TaskRunner> init_task_runner = 131 scoped_refptr<base::TaskRunner> init_task_runner =
132 ViewsDelegate::views_delegate->GetBlockingPoolTaskRunner(); 132 ViewsDelegate::GetInstance()->GetBlockingPoolTaskRunner();
133 if (init_task_runner) 133 if (init_task_runner)
134 ui::AXPlatformNodeAuraLinux::StaticInitialize(init_task_runner); 134 ui::AXPlatformNodeAuraLinux::StaticInitialize(init_task_runner);
135 } 135 }
136 } 136 }
137 137
138 ~AuraLinuxApplication() override { 138 ~AuraLinuxApplication() override {
139 platform_node_->Destroy(); 139 platform_node_->Destroy();
140 platform_node_ = nullptr; 140 platform_node_ = nullptr;
141 } 141 }
142 142
(...skipping 20 matching lines...) Expand all
163 } 163 }
164 164
165 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { 165 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() {
166 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); 166 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent();
167 if (!parent) 167 if (!parent)
168 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); 168 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible();
169 return parent; 169 return parent;
170 } 170 }
171 171
172 } // namespace views 172 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698