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

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2113053003: Moves Shell::maximize_mode_controller() to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 5 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/frame/custom_frame_view_ash_unittest.cc ('k') | ash/shell.h » ('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/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.h"
6 6
7 #include "ash/common/default_accessibility_delegate.h" 7 #include "ash/common/default_accessibility_delegate.h"
8 #include "ash/common/display/display_info.h" 8 #include "ash/common/display/display_info.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shell_observer.h" 10 #include "ash/common/shell_observer.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); 90 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub);
91 }; 91 };
92 92
93 } // namespace 93 } // namespace
94 94
95 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) 95 WmShellMus::WmShellMus(::mus::WindowTreeClient* client)
96 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { 96 : client_(client), session_state_delegate_(new SessionStateDelegateStub) {
97 client_->AddObserver(this); 97 client_->AddObserver(this);
98 WmShell::Set(this); 98 WmShell::Set(this);
99 99
100 CreateMaximizeModeController();
101
100 CreateMruWindowTracker(); 102 CreateMruWindowTracker();
101 103
102 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); 104 accessibility_delegate_.reset(new DefaultAccessibilityDelegate);
103 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); 105 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate));
104 } 106 }
105 107
106 WmShellMus::~WmShellMus() { 108 WmShellMus::~WmShellMus() {
109 // This order mirrors that of Shell.
110
111 // Destroy maximize mode controller early on since it has some observers which
112 // need to be removed.
113 DeleteMaximizeModeController();
107 DeleteSystemTrayDelegate(); 114 DeleteSystemTrayDelegate();
108 DeleteWindowSelectorController(); 115 DeleteWindowSelectorController();
109 DeleteMruWindowTracker(); 116 DeleteMruWindowTracker();
110 RemoveClientObserver(); 117 RemoveClientObserver();
111 WmShell::Set(nullptr); 118 WmShell::Set(nullptr);
112 } 119 }
113 120
114 // static 121 // static
115 WmShellMus* WmShellMus::Get() { 122 WmShellMus* WmShellMus::Get() {
116 return static_cast<WmShellMus*>(WmShell::Get()); 123 return static_cast<WmShellMus*>(WmShell::Get());
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 OnWindowActivated(gained_active, lost_active)); 328 OnWindowActivated(gained_active, lost_active));
322 } 329 }
323 330
324 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { 331 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) {
325 DCHECK_EQ(client, client_); 332 DCHECK_EQ(client, client_);
326 RemoveClientObserver(); 333 RemoveClientObserver();
327 } 334 }
328 335
329 } // namespace mus 336 } // namespace mus
330 } // namespace ash 337 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/custom_frame_view_ash_unittest.cc ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698