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

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

Issue 2042913002: Converts MruWindowTracker to work with common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not equal Created 4 years, 6 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/mus/bridge/wm_shell_mus.h ('k') | ash/mus/bridge/wm_window_mus.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/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/common/wm/window_resizer.h" 8 #include "ash/common/wm/window_resizer.h"
9 #include "ash/common/wm_activation_observer.h" 9 #include "ash/common/wm_activation_observer.h"
10 #include "ash/mus/bridge/wm_root_window_controller_mus.h" 10 #include "ash/mus/bridge/wm_root_window_controller_mus.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 bool WmShellMus::IsUserSessionBlocked() { 112 bool WmShellMus::IsUserSessionBlocked() {
113 NOTIMPLEMENTED(); 113 NOTIMPLEMENTED();
114 return false; 114 return false;
115 } 115 }
116 116
117 bool WmShellMus::IsScreenLocked() { 117 bool WmShellMus::IsScreenLocked() {
118 NOTIMPLEMENTED(); 118 NOTIMPLEMENTED();
119 return false; 119 return false;
120 } 120 }
121 121
122 bool WmShellMus::CanShowWindowForUser(WmWindow* window) {
123 NOTIMPLEMENTED();
124 return true;
125 }
126
122 void WmShellMus::LockCursor() { 127 void WmShellMus::LockCursor() {
123 NOTIMPLEMENTED(); 128 NOTIMPLEMENTED();
124 } 129 }
125 130
126 void WmShellMus::UnlockCursor() { 131 void WmShellMus::UnlockCursor() {
127 NOTIMPLEMENTED(); 132 NOTIMPLEMENTED();
128 } 133 }
129 134
130 std::vector<WmWindow*> WmShellMus::GetAllRootWindows() { 135 std::vector<WmWindow*> WmShellMus::GetAllRootWindows() {
131 std::vector<WmWindow*> wm_windows(root_window_controllers_.size()); 136 std::vector<WmWindow*> wm_windows(root_window_controllers_.size());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 void WmShellMus::AddOverviewModeObserver(WmOverviewModeObserver* observer) { 179 void WmShellMus::AddOverviewModeObserver(WmOverviewModeObserver* observer) {
175 NOTIMPLEMENTED(); 180 NOTIMPLEMENTED();
176 } 181 }
177 182
178 void WmShellMus::RemoveOverviewModeObserver(WmOverviewModeObserver* observer) { 183 void WmShellMus::RemoveOverviewModeObserver(WmOverviewModeObserver* observer) {
179 NOTIMPLEMENTED(); 184 NOTIMPLEMENTED();
180 } 185 }
181 186
182 // static 187 // static
183 bool WmShellMus::IsActivationParent(::mus::Window* window) { 188 bool WmShellMus::IsActivationParent(::mus::Window* window) {
184 if (!window) 189 return window && IsActivatableShellWindowId(
185 return false; 190 WmWindowMus::Get(window)->GetShellWindowId());
186
187 const int shell_window_id = WmWindowMus::Get(window)->GetShellWindowId();
188 for (size_t i = 0; i < kNumActivatableShellWindowIds; ++i) {
189 if (shell_window_id == kActivatableShellWindowIds[i])
190 return true;
191 }
192 return false;
193 } 191 }
194 192
195 void WmShellMus::RemoveClientObserver() { 193 void WmShellMus::RemoveClientObserver() {
196 if (!client_) 194 if (!client_)
197 return; 195 return;
198 196
199 client_->RemoveObserver(this); 197 client_->RemoveObserver(this);
200 client_ = nullptr; 198 client_ = nullptr;
201 } 199 }
202 200
203 // TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114. 201 // TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114.
204 void WmShellMus::OnWindowTreeFocusChanged(::mus::Window* gained_focus, 202 void WmShellMus::OnWindowTreeFocusChanged(::mus::Window* gained_focus,
205 ::mus::Window* lost_focus) { 203 ::mus::Window* lost_focus) {
206 WmWindowMus* gained_active = GetToplevelAncestor(gained_focus); 204 WmWindowMus* gained_active = GetToplevelAncestor(gained_focus);
207 WmWindowMus* lost_active = GetToplevelAncestor(gained_focus); 205 WmWindowMus* lost_active = GetToplevelAncestor(gained_focus);
208 if (gained_active == lost_active) 206 if (gained_active == lost_active)
209 return; 207 return;
210 208
211 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, 209 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_,
212 OnWindowActivated(gained_active, lost_active)); 210 OnWindowActivated(gained_active, lost_active));
213 } 211 }
214 212
215 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) { 213 void WmShellMus::OnWillDestroyClient(::mus::WindowTreeClient* client) {
216 DCHECK_EQ(client, client_); 214 DCHECK_EQ(client, client_);
217 RemoveClientObserver(); 215 RemoveClientObserver();
218 } 216 }
219 217
220 } // namespace mus 218 } // namespace mus
221 } // namespace ash 219 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/bridge/wm_window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698