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

Side by Side Diff: ash/shell.cc

Issue 2801333002: mash: Run pre-unlock animation via SessionController (Closed)
Patch Set: fix compile Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 void Shell::SetDisplayWorkAreaInsets(Window* contains, 326 void Shell::SetDisplayWorkAreaInsets(Window* contains,
327 const gfx::Insets& insets) { 327 const gfx::Insets& insets) {
328 wm_shell_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); 328 wm_shell_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets);
329 } 329 }
330 330
331 void Shell::OnAppTerminating() { 331 void Shell::OnAppTerminating() {
332 for (auto& observer : shell_observers_) 332 for (auto& observer : shell_observers_)
333 observer.OnAppTerminating(); 333 observer.OnAppTerminating();
334 } 334 }
335 335
336 void Shell::OnLockStateChanged(bool locked) {
337 for (auto& observer : shell_observers_)
338 observer.OnLockStateChanged(locked);
339 #ifndef NDEBUG
340 // Make sure that there is no system modal in Lock layer when unlocked.
341 if (!locked) {
342 aura::Window::Windows containers = wm::GetContainersFromAllRootWindows(
343 kShellWindowId_LockSystemModalContainer, GetPrimaryRootWindow());
344 for (aura::Window* container : containers)
345 DCHECK(container->children().empty());
346 }
347 #endif
348 }
349
350 void Shell::OnCastingSessionStartedOrStopped(bool started) { 336 void Shell::OnCastingSessionStartedOrStopped(bool started) {
351 for (auto& observer : shell_observers_) 337 for (auto& observer : shell_observers_)
352 observer.OnCastingSessionStartedOrStopped(started); 338 observer.OnCastingSessionStartedOrStopped(started);
353 } 339 }
354 340
355 void Shell::OnRootWindowAdded(WmWindow* root_window) { 341 void Shell::OnRootWindowAdded(WmWindow* root_window) {
356 for (auto& observer : shell_observers_) 342 for (auto& observer : shell_observers_)
357 observer.OnRootWindowAdded(root_window); 343 observer.OnRootWindowAdded(root_window);
358 } 344 }
359 345
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 } 1230 }
1245 1231
1246 void Shell::LoginStatusChanged(LoginStatus login_status) { 1232 void Shell::LoginStatusChanged(LoginStatus login_status) {
1247 UpdateAfterLoginStatusChange(login_status); 1233 UpdateAfterLoginStatusChange(login_status);
1248 1234
1249 // TODO(xiyuan): Update OnLoginStateChanged -> OnLoginStatusChanged. 1235 // TODO(xiyuan): Update OnLoginStateChanged -> OnLoginStatusChanged.
1250 for (auto& observer : shell_observers_) 1236 for (auto& observer : shell_observers_)
1251 observer.OnLoginStateChanged(login_status); 1237 observer.OnLoginStateChanged(login_status);
1252 } 1238 }
1253 1239
1240 void Shell::OnLockStateChanged(bool locked) {
1241 for (auto& observer : shell_observers_)
1242 observer.OnLockStateChanged(locked);
James Cook 2017/04/07 20:26:55 Aside: It's unfortunate that we have Shell observe
xiyuan 2017/04/07 21:50:01 SGTM. Added a TODO. I have thought about doing tha
1243 #ifndef NDEBUG
1244 // Make sure that there is no system modal in Lock layer when unlocked.
1245 if (!locked) {
1246 aura::Window::Windows containers = wm::GetContainersFromAllRootWindows(
1247 kShellWindowId_LockSystemModalContainer, GetPrimaryRootWindow());
1248 for (aura::Window* container : containers)
1249 DCHECK(container->children().empty());
1250 }
1251 #endif
1252 }
1253
1254 void Shell::OnPrefServiceInitialized( 1254 void Shell::OnPrefServiceInitialized(
1255 std::unique_ptr<::PrefService> pref_service) { 1255 std::unique_ptr<::PrefService> pref_service) {
1256 if (!instance_) 1256 if (!instance_)
1257 return; 1257 return;
1258 DCHECK(pref_service); 1258 DCHECK(pref_service);
1259 pref_service_ = std::move(pref_service); 1259 pref_service_ = std::move(pref_service);
1260 } 1260 }
1261 1261
1262 } // namespace ash 1262 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698