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

Unified Diff: ash/wallpaper/wallpaper_controller.cc

Issue 2832053003: cros: WallpaperController reparent based on session state (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wallpaper/wallpaper_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wallpaper/wallpaper_controller.cc
diff --git a/ash/wallpaper/wallpaper_controller.cc b/ash/wallpaper/wallpaper_controller.cc
index 9c0ecc465970bb47cf460edb0315d70a365bf41d..15f2cc03cdf7ace5fa513b7cf1dcb48d6ec4e02f 100644
--- a/ash/wallpaper/wallpaper_controller.cc
+++ b/ash/wallpaper/wallpaper_controller.cc
@@ -168,20 +168,6 @@ void WallpaperController::CreateEmptyWallpaper() {
InstallDesktopControllerForAllWindows();
}
-bool WallpaperController::MoveToLockedContainer() {
- if (locked_)
- return false;
- locked_ = true;
- return ReparentWallpaper(GetWallpaperContainerId(true));
-}
-
-bool WallpaperController::MoveToUnlockedContainer() {
- if (!locked_)
- return false;
- locked_ = false;
- return ReparentWallpaper(GetWallpaperContainerId(false));
-}
-
void WallpaperController::OnDisplayConfigurationChanged() {
gfx::Size max_display_size = GetMaxDisplaySizeInNative();
if (current_max_display_size_ != max_display_size) {
@@ -215,6 +201,11 @@ void WallpaperController::OnRootWindowAdded(WmWindow* root_window) {
void WallpaperController::OnSessionStateChanged(
session_manager::SessionState state) {
CalculateWallpaperColors();
+
+ if (state == session_manager::SessionState::ACTIVE)
+ MoveToUnlockedContainer();
+ else
+ MoveToLockedContainer();
}
// static
@@ -401,4 +392,20 @@ bool WallpaperController::ShouldCalculateColors() const {
!image.isNull();
}
+bool WallpaperController::MoveToLockedContainer() {
+ if (locked_)
+ return false;
+
+ locked_ = true;
+ return ReparentWallpaper(GetWallpaperContainerId(true));
+}
+
+bool WallpaperController::MoveToUnlockedContainer() {
+ if (!locked_)
+ return false;
+
+ locked_ = false;
+ return ReparentWallpaper(GetWallpaperContainerId(false));
+}
+
} // namespace ash
« no previous file with comments | « ash/wallpaper/wallpaper_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698