| 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/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shell_observer.h" | 9 #include "ash/common/shell_observer.h" |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } // namespace | 91 } // namespace |
| 92 | 92 |
| 93 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) | 93 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) |
| 94 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { | 94 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { |
| 95 client_->AddObserver(this); | 95 client_->AddObserver(this); |
| 96 WmShell::Set(this); | 96 WmShell::Set(this); |
| 97 | 97 |
| 98 wm_shell_common_.reset(new WmShellCommon); | 98 wm_shell_common_.reset(new WmShellCommon); |
| 99 wm_shell_common_->CreateMruWindowTracker(); | 99 wm_shell_common_->CreateMruWindowTracker(); |
| 100 | 100 |
| 101 CreateWindowSelectorController(); |
| 102 |
| 101 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); | 103 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); |
| 102 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); | 104 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); |
| 103 } | 105 } |
| 104 | 106 |
| 105 WmShellMus::~WmShellMus() { | 107 WmShellMus::~WmShellMus() { |
| 106 SetSystemTrayDelegate(nullptr); | 108 SetSystemTrayDelegate(nullptr); |
| 109 DeleteWindowSelectorController(); |
| 107 wm_shell_common_->DeleteMruWindowTracker(); | 110 wm_shell_common_->DeleteMruWindowTracker(); |
| 108 RemoveClientObserver(); | 111 RemoveClientObserver(); |
| 109 WmShell::Set(nullptr); | 112 WmShell::Set(nullptr); |
| 110 } | 113 } |
| 111 | 114 |
| 112 // static | 115 // static |
| 113 WmShellMus* WmShellMus::Get() { | 116 WmShellMus* WmShellMus::Get() { |
| 114 return static_cast<WmShellMus*>(WmShell::Get()); | 117 return static_cast<WmShellMus*>(WmShell::Get()); |
| 115 } | 118 } |
| 116 | 119 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void WmShellMus::OnOverviewModeStarting() { | 228 void WmShellMus::OnOverviewModeStarting() { |
| 226 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), | 229 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
| 227 OnOverviewModeStarting()); | 230 OnOverviewModeStarting()); |
| 228 } | 231 } |
| 229 | 232 |
| 230 void WmShellMus::OnOverviewModeEnded() { | 233 void WmShellMus::OnOverviewModeEnded() { |
| 231 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), | 234 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
| 232 OnOverviewModeEnded()); | 235 OnOverviewModeEnded()); |
| 233 } | 236 } |
| 234 | 237 |
| 235 bool WmShellMus::IsOverviewModeSelecting() { | |
| 236 NOTIMPLEMENTED(); | |
| 237 return false; | |
| 238 } | |
| 239 | |
| 240 bool WmShellMus::IsOverviewModeRestoringMinimizedWindows() { | |
| 241 NOTIMPLEMENTED(); | |
| 242 return false; | |
| 243 } | |
| 244 | |
| 245 AccessibilityDelegate* WmShellMus::GetAccessibilityDelegate() { | 238 AccessibilityDelegate* WmShellMus::GetAccessibilityDelegate() { |
| 246 return accessibility_delegate_.get(); | 239 return accessibility_delegate_.get(); |
| 247 } | 240 } |
| 248 | 241 |
| 249 SessionStateDelegate* WmShellMus::GetSessionStateDelegate() { | 242 SessionStateDelegate* WmShellMus::GetSessionStateDelegate() { |
| 250 return session_state_delegate_.get(); | 243 return session_state_delegate_.get(); |
| 251 } | 244 } |
| 252 | 245 |
| 253 void WmShellMus::AddActivationObserver(WmActivationObserver* observer) { | 246 void WmShellMus::AddActivationObserver(WmActivationObserver* observer) { |
| 254 activation_observers_.AddObserver(observer); | 247 activation_observers_.AddObserver(observer); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 OnWindowActivated(gained_active, lost_active)); | 308 OnWindowActivated(gained_active, lost_active)); |
| 316 } | 309 } |
| 317 | 310 |
| 318 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { | 311 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { |
| 319 DCHECK_EQ(client, client_); | 312 DCHECK_EQ(client, client_); |
| 320 RemoveClientObserver(); | 313 RemoveClientObserver(); |
| 321 } | 314 } |
| 322 | 315 |
| 323 } // namespace mus | 316 } // namespace mus |
| 324 } // namespace ash | 317 } // namespace ash |
| OLD | NEW |