OLD | NEW |
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/wallpaper/wallpaper_controller.h" | 5 #include "ash/wallpaper/wallpaper_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 320 |
321 bool WallpaperController::ReparentWallpaper(int container) { | 321 bool WallpaperController::ReparentWallpaper(int container) { |
322 bool moved = false; | 322 bool moved = false; |
323 for (auto* root_window_controller : Shell::GetAllRootWindowControllers()) { | 323 for (auto* root_window_controller : Shell::GetAllRootWindowControllers()) { |
324 // In the steady state (no animation playing) the wallpaper widget | 324 // In the steady state (no animation playing) the wallpaper widget |
325 // controller exists in the RootWindowController. | 325 // controller exists in the RootWindowController. |
326 WallpaperWidgetController* wallpaper_widget_controller = | 326 WallpaperWidgetController* wallpaper_widget_controller = |
327 root_window_controller->wallpaper_widget_controller(); | 327 root_window_controller->wallpaper_widget_controller(); |
328 if (wallpaper_widget_controller) { | 328 if (wallpaper_widget_controller) { |
329 moved |= wallpaper_widget_controller->Reparent( | 329 moved |= wallpaper_widget_controller->Reparent( |
330 root_window_controller->GetWindow(), container); | 330 root_window_controller->GetRootWindow(), container); |
331 } | 331 } |
332 // During wallpaper show animations the controller lives in | 332 // During wallpaper show animations the controller lives in |
333 // AnimatingWallpaperWidgetController owned by RootWindowController. | 333 // AnimatingWallpaperWidgetController owned by RootWindowController. |
334 // NOTE: If an image load happens during a wallpaper show animation there | 334 // NOTE: If an image load happens during a wallpaper show animation there |
335 // can temporarily be two wallpaper widgets. We must reparent both of them, | 335 // can temporarily be two wallpaper widgets. We must reparent both of them, |
336 // one above and one here. | 336 // one above and one here. |
337 WallpaperWidgetController* animating_controller = | 337 WallpaperWidgetController* animating_controller = |
338 root_window_controller->animating_wallpaper_widget_controller() | 338 root_window_controller->animating_wallpaper_widget_controller() |
339 ? root_window_controller->animating_wallpaper_widget_controller() | 339 ? root_window_controller->animating_wallpaper_widget_controller() |
340 ->GetController(false) | 340 ->GetController(false) |
341 : nullptr; | 341 : nullptr; |
342 if (animating_controller) { | 342 if (animating_controller) { |
343 moved |= animating_controller->Reparent( | 343 moved |= animating_controller->Reparent( |
344 root_window_controller->GetWindow(), container); | 344 root_window_controller->GetRootWindow(), container); |
345 } | 345 } |
346 } | 346 } |
347 return moved; | 347 return moved; |
348 } | 348 } |
349 | 349 |
350 int WallpaperController::GetWallpaperContainerId(bool locked) { | 350 int WallpaperController::GetWallpaperContainerId(bool locked) { |
351 return locked ? kShellWindowId_LockScreenWallpaperContainer | 351 return locked ? kShellWindowId_LockScreenWallpaperContainer |
352 : kShellWindowId_WallpaperContainer; | 352 : kShellWindowId_WallpaperContainer; |
353 } | 353 } |
354 | 354 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); | 424 base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs)); |
425 } | 425 } |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 void WallpaperController::CompositorLockTimedOut() { | 429 void WallpaperController::CompositorLockTimedOut() { |
430 compositor_lock_.reset(); | 430 compositor_lock_.reset(); |
431 } | 431 } |
432 | 432 |
433 } // namespace ash | 433 } // namespace ash |
OLD | NEW |