| 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" |
| 11 #include "ash/common/system/tray/default_system_tray_delegate.h" |
| 11 #include "ash/common/wm/mru_window_tracker.h" | 12 #include "ash/common/wm/mru_window_tracker.h" |
| 12 #include "ash/common/wm/window_resizer.h" | 13 #include "ash/common/wm/window_resizer.h" |
| 13 #include "ash/common/wm_activation_observer.h" | 14 #include "ash/common/wm_activation_observer.h" |
| 14 #include "ash/common/wm_shell_common.h" | 15 #include "ash/common/wm_shell_common.h" |
| 15 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 16 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
| 16 #include "ash/mus/bridge/wm_window_mus.h" | 17 #include "ash/mus/bridge/wm_window_mus.h" |
| 17 #include "ash/mus/container_ids.h" | 18 #include "ash/mus/container_ids.h" |
| 18 #include "ash/mus/drag_window_resizer.h" | 19 #include "ash/mus/drag_window_resizer.h" |
| 19 #include "ash/mus/root_window_controller.h" | 20 #include "ash/mus/root_window_controller.h" |
| 20 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 92 |
| 92 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) | 93 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) |
| 93 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { | 94 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { |
| 94 client_->AddObserver(this); | 95 client_->AddObserver(this); |
| 95 WmShell::Set(this); | 96 WmShell::Set(this); |
| 96 | 97 |
| 97 wm_shell_common_.reset(new WmShellCommon); | 98 wm_shell_common_.reset(new WmShellCommon); |
| 98 wm_shell_common_->CreateMruWindowTracker(); | 99 wm_shell_common_->CreateMruWindowTracker(); |
| 99 | 100 |
| 100 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); | 101 accessibility_delegate_.reset(new DefaultAccessibilityDelegate); |
| 102 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); |
| 101 } | 103 } |
| 102 | 104 |
| 103 WmShellMus::~WmShellMus() { | 105 WmShellMus::~WmShellMus() { |
| 106 SetSystemTrayDelegate(nullptr); |
| 104 wm_shell_common_->DeleteMruWindowTracker(); | 107 wm_shell_common_->DeleteMruWindowTracker(); |
| 105 RemoveClientObserver(); | 108 RemoveClientObserver(); |
| 106 WmShell::Set(nullptr); | 109 WmShell::Set(nullptr); |
| 107 } | 110 } |
| 108 | 111 |
| 109 // static | 112 // static |
| 110 WmShellMus* WmShellMus::Get() { | 113 WmShellMus* WmShellMus::Get() { |
| 111 return static_cast<WmShellMus*>(WmShell::Get()); | 114 return static_cast<WmShellMus*>(WmShell::Get()); |
| 112 } | 115 } |
| 113 | 116 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 OnWindowActivated(gained_active, lost_active)); | 291 OnWindowActivated(gained_active, lost_active)); |
| 289 } | 292 } |
| 290 | 293 |
| 291 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { | 294 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { |
| 292 DCHECK_EQ(client, client_); | 295 DCHECK_EQ(client, client_); |
| 293 RemoveClientObserver(); | 296 RemoveClientObserver(); |
| 294 } | 297 } |
| 295 | 298 |
| 296 } // namespace mus | 299 } // namespace mus |
| 297 } // namespace ash | 300 } // namespace ash |
| OLD | NEW |