| 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/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/mru_window_tracker.h" |
| 9 #include "ash/common/wm/window_resizer.h" | 10 #include "ash/common/wm/window_resizer.h" |
| 10 #include "ash/common/wm_activation_observer.h" | 11 #include "ash/common/wm_activation_observer.h" |
| 12 #include "ash/common/wm_shell_common.h" |
| 11 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 13 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
| 12 #include "ash/mus/bridge/wm_window_mus.h" | 14 #include "ash/mus/bridge/wm_window_mus.h" |
| 13 #include "ash/mus/container_ids.h" | 15 #include "ash/mus/container_ids.h" |
| 14 #include "ash/mus/drag_window_resizer.h" | 16 #include "ash/mus/drag_window_resizer.h" |
| 15 #include "ash/mus/root_window_controller.h" | 17 #include "ash/mus/root_window_controller.h" |
| 16 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 17 #include "components/mus/common/util.h" | 19 #include "components/mus/common/util.h" |
| 18 #include "components/mus/public/cpp/window.h" | 20 #include "components/mus/public/cpp/window.h" |
| 19 #include "components/mus/public/cpp/window_tree_client.h" | 21 #include "components/mus/public/cpp/window_tree_client.h" |
| 20 #include "components/user_manager/user_info_impl.h" | 22 #include "components/user_manager/user_info_impl.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 84 |
| 83 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); | 85 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 } // namespace | 88 } // namespace |
| 87 | 89 |
| 88 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) | 90 WmShellMus::WmShellMus(::mus::WindowTreeClient* client) |
| 89 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { | 91 : client_(client), session_state_delegate_(new SessionStateDelegateStub) { |
| 90 client_->AddObserver(this); | 92 client_->AddObserver(this); |
| 91 WmShell::Set(this); | 93 WmShell::Set(this); |
| 94 |
| 95 wm_shell_common_.reset(new WmShellCommon); |
| 96 wm_shell_common_->CreateMruWindowTracker(); |
| 92 } | 97 } |
| 93 | 98 |
| 94 WmShellMus::~WmShellMus() { | 99 WmShellMus::~WmShellMus() { |
| 100 wm_shell_common_->DeleteMruWindowTracker(); |
| 95 RemoveClientObserver(); | 101 RemoveClientObserver(); |
| 96 WmShell::Set(nullptr); | 102 WmShell::Set(nullptr); |
| 97 } | 103 } |
| 98 | 104 |
| 99 // static | 105 // static |
| 100 WmShellMus* WmShellMus::Get() { | 106 WmShellMus* WmShellMus::Get() { |
| 101 return static_cast<WmShellMus*>(WmShell::Get()); | 107 return static_cast<WmShellMus*>(WmShell::Get()); |
| 102 } | 108 } |
| 103 | 109 |
| 104 void WmShellMus::AddRootWindowController( | 110 void WmShellMus::AddRootWindowController( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 128 int64_t id) { | 134 int64_t id) { |
| 129 for (WmRootWindowControllerMus* root_window_controller : | 135 for (WmRootWindowControllerMus* root_window_controller : |
| 130 root_window_controllers_) { | 136 root_window_controllers_) { |
| 131 if (root_window_controller->GetDisplay().id() == id) | 137 if (root_window_controller->GetDisplay().id() == id) |
| 132 return root_window_controller; | 138 return root_window_controller; |
| 133 } | 139 } |
| 134 NOTREACHED(); | 140 NOTREACHED(); |
| 135 return nullptr; | 141 return nullptr; |
| 136 } | 142 } |
| 137 | 143 |
| 144 MruWindowTracker* WmShellMus::GetMruWindowTracker() { |
| 145 return wm_shell_common_->mru_window_tracker(); |
| 146 } |
| 147 |
| 138 WmWindow* WmShellMus::NewContainerWindow() { | 148 WmWindow* WmShellMus::NewContainerWindow() { |
| 139 return WmWindowMus::Get(client_->NewWindow()); | 149 return WmWindowMus::Get(client_->NewWindow()); |
| 140 } | 150 } |
| 141 | 151 |
| 142 WmWindow* WmShellMus::GetFocusedWindow() { | 152 WmWindow* WmShellMus::GetFocusedWindow() { |
| 143 return WmWindowMus::Get(client_->GetFocusedWindow()); | 153 return WmWindowMus::Get(client_->GetFocusedWindow()); |
| 144 } | 154 } |
| 145 | 155 |
| 146 WmWindow* WmShellMus::GetActiveWindow() { | 156 WmWindow* WmShellMus::GetActiveWindow() { |
| 147 return GetToplevelAncestor(client_->GetFocusedWindow()); | 157 return GetToplevelAncestor(client_->GetFocusedWindow()); |
| 148 } | 158 } |
| 149 | 159 |
| 150 WmWindow* WmShellMus::GetPrimaryRootWindow() { | 160 WmWindow* WmShellMus::GetPrimaryRootWindow() { |
| 151 return root_window_controllers_[0]->GetWindow(); | 161 return root_window_controllers_[0]->GetWindow(); |
| 152 } | 162 } |
| 153 | 163 |
| 154 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { | 164 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { |
| 155 return GetRootWindowControllerWithDisplayId(display_id)->GetWindow(); | 165 return GetRootWindowControllerWithDisplayId(display_id)->GetWindow(); |
| 156 } | 166 } |
| 157 | 167 |
| 158 WmWindow* WmShellMus::GetRootWindowForNewWindows() { | 168 WmWindow* WmShellMus::GetRootWindowForNewWindows() { |
| 159 NOTIMPLEMENTED(); | 169 NOTIMPLEMENTED(); |
| 160 return root_window_controllers_[0]->GetWindow(); | 170 return root_window_controllers_[0]->GetWindow(); |
| 161 } | 171 } |
| 162 | 172 |
| 163 std::vector<WmWindow*> WmShellMus::GetMruWindowList() { | |
| 164 NOTIMPLEMENTED(); | |
| 165 return std::vector<WmWindow*>(); | |
| 166 } | |
| 167 | |
| 168 std::vector<WmWindow*> WmShellMus::GetMruWindowListIgnoreModals() { | |
| 169 NOTIMPLEMENTED(); | |
| 170 return std::vector<WmWindow*>(); | |
| 171 } | |
| 172 | |
| 173 bool WmShellMus::IsForceMaximizeOnFirstRun() { | 173 bool WmShellMus::IsForceMaximizeOnFirstRun() { |
| 174 NOTIMPLEMENTED(); | 174 NOTIMPLEMENTED(); |
| 175 return false; | 175 return false; |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool WmShellMus::CanShowWindowForUser(WmWindow* window) { | 178 bool WmShellMus::CanShowWindowForUser(WmWindow* window) { |
| 179 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 OnWindowActivated(gained_active, lost_active)); | 270 OnWindowActivated(gained_active, lost_active)); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { | 273 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { |
| 274 DCHECK_EQ(client, client_); | 274 DCHECK_EQ(client, client_); |
| 275 RemoveClientObserver(); | 275 RemoveClientObserver(); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace mus | 278 } // namespace mus |
| 279 } // namespace ash | 279 } // namespace ash |
| OLD | NEW |