| OLD | NEW |
| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 } // namespace | 93 } // namespace |
| 94 | 94 |
| 95 WmShellMus::WmShellMus(ShellDelegate* delegate, ::ui::WindowTreeClient* client) | 95 WmShellMus::WmShellMus(ShellDelegate* delegate, ::ui::WindowTreeClient* client) |
| 96 : WmShell(delegate), | 96 : WmShell(delegate), |
| 97 client_(client), | 97 client_(client), |
| 98 session_state_delegate_(new SessionStateDelegateStub) { | 98 session_state_delegate_(new SessionStateDelegateStub) { |
| 99 client_->AddObserver(this); | 99 client_->AddObserver(this); |
| 100 WmShell::Set(this); | 100 WmShell::Set(this); |
| 101 | 101 |
| 102 CreateMaximizeModeController(); |
| 103 |
| 102 CreateMruWindowTracker(); | 104 CreateMruWindowTracker(); |
| 103 | 105 |
| 104 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); | 106 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); |
| 105 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); | 107 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); |
| 106 } | 108 } |
| 107 | 109 |
| 108 WmShellMus::~WmShellMus() { | 110 WmShellMus::~WmShellMus() { |
| 109 // This order mirrors that of Shell. | 111 // This order mirrors that of Shell. |
| 110 | 112 |
| 113 // Destroy maximize mode controller early on since it has some observers which |
| 114 // need to be removed. |
| 115 DeleteMaximizeModeController(); |
| 111 DeleteSystemTrayDelegate(); | 116 DeleteSystemTrayDelegate(); |
| 112 DeleteWindowSelectorController(); | 117 DeleteWindowSelectorController(); |
| 113 DeleteMruWindowTracker(); | 118 DeleteMruWindowTracker(); |
| 114 RemoveClientObserver(); | 119 RemoveClientObserver(); |
| 115 WmShell::Set(nullptr); | 120 WmShell::Set(nullptr); |
| 116 } | 121 } |
| 117 | 122 |
| 118 // static | 123 // static |
| 119 WmShellMus* WmShellMus::Get() { | 124 WmShellMus* WmShellMus::Get() { |
| 120 return static_cast<WmShellMus*>(WmShell::Get()); | 125 return static_cast<WmShellMus*>(WmShell::Get()); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 OnWindowActivated(gained_active, lost_active)); | 330 OnWindowActivated(gained_active, lost_active)); |
| 326 } | 331 } |
| 327 | 332 |
| 328 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) { | 333 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) { |
| 329 DCHECK_EQ(client, client_); | 334 DCHECK_EQ(client, client_); |
| 330 RemoveClientObserver(); | 335 RemoveClientObserver(); |
| 331 } | 336 } |
| 332 | 337 |
| 333 } // namespace mus | 338 } // namespace mus |
| 334 } // namespace ash | 339 } // namespace ash |
| OLD | NEW |