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

Side by Side Diff: ash/aura/shell_port_classic.cc

Issue 2815043002: Removes ShellPort::IsRunningInMash() (Closed)
Patch Set: dont set instance_ in constructor Created 3 years, 8 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
« no previous file with comments | « ash/aura/shell_port_classic.h ('k') | ash/autoclick/autoclick_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/aura/shell_port_classic.h" 5 #include "ash/aura/shell_port_classic.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/accelerator_controller.h" 9 #include "ash/accelerators/accelerator_controller.h"
10 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 10 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #endif 47 #endif
48 48
49 namespace ash { 49 namespace ash {
50 50
51 ShellPortClassic::ShellPortClassic() {} 51 ShellPortClassic::ShellPortClassic() {}
52 52
53 ShellPortClassic::~ShellPortClassic() {} 53 ShellPortClassic::~ShellPortClassic() {}
54 54
55 // static 55 // static
56 ShellPortClassic* ShellPortClassic::Get() { 56 ShellPortClassic* ShellPortClassic::Get() {
57 CHECK(!ShellPort::Get()->IsRunningInMash()); 57 CHECK(Shell::GetAshConfig() == Config::CLASSIC);
58 return static_cast<ShellPortClassic*>(ShellPort::Get()); 58 return static_cast<ShellPortClassic*>(ShellPort::Get());
59 } 59 }
60 60
61 void ShellPortClassic::Shutdown() { 61 void ShellPortClassic::Shutdown() {
62 if (added_display_observer_) 62 if (added_display_observer_)
63 Shell::Get()->window_tree_host_manager()->RemoveObserver(this); 63 Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
64 64
65 pointer_watcher_adapter_.reset(); 65 pointer_watcher_adapter_.reset();
66 66
67 ShellPort::Shutdown(); 67 ShellPort::Shutdown();
68 68
69 Shell::Get()->window_tree_host_manager()->Shutdown(); 69 Shell::Get()->window_tree_host_manager()->Shutdown();
70 } 70 }
71 71
72 bool ShellPortClassic::IsRunningInMash() const {
73 return false;
74 }
75
76 Config ShellPortClassic::GetAshConfig() const { 72 Config ShellPortClassic::GetAshConfig() const {
77 return Config::CLASSIC; 73 return Config::CLASSIC;
78 } 74 }
79 75
80 WmWindow* ShellPortClassic::GetPrimaryRootWindow() { 76 WmWindow* ShellPortClassic::GetPrimaryRootWindow() {
81 return WmWindow::Get( 77 return WmWindow::Get(
82 Shell::Get()->window_tree_host_manager()->GetPrimaryRootWindow()); 78 Shell::Get()->window_tree_host_manager()->GetPrimaryRootWindow());
83 } 79 }
84 80
85 WmWindow* ShellPortClassic::GetRootWindowForDisplayId(int64_t display_id) { 81 WmWindow* ShellPortClassic::GetRootWindowForDisplayId(int64_t display_id) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 for (auto& observer : display_observers_) 262 for (auto& observer : display_observers_)
267 observer.OnDisplayConfigurationChanging(); 263 observer.OnDisplayConfigurationChanging();
268 } 264 }
269 265
270 void ShellPortClassic::OnDisplayConfigurationChanged() { 266 void ShellPortClassic::OnDisplayConfigurationChanged() {
271 for (auto& observer : display_observers_) 267 for (auto& observer : display_observers_)
272 observer.OnDisplayConfigurationChanged(); 268 observer.OnDisplayConfigurationChanged();
273 } 269 }
274 270
275 } // namespace ash 271 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/shell_port_classic.h ('k') | ash/autoclick/autoclick_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698