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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10459003: Load user custom wallpaper after browser crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 8 years, 7 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
Index: ash/desktop_background/desktop_background_controller.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index 5b2562e39f8f7f2156f6b680f9e375ee05a0a8a3..79ec7f7ca71e3960be8b1aead000d9d3841f4c66 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -91,6 +91,13 @@ void DesktopBackgroundController::SetDefaultWallpaper(int index) {
if (previous_index_ == index)
return;
+ // We should not change background when index is invalid. For instance, at
+ // login screen or stub_user login.
+ if (index == ash::GetInvalidWallpaperIndex()) {
+ CreateEmptyWallpaper();
+ return;
+ }
+
CancelPendingWallpaperOperation();
wallpaper_op_ = new WallpaperOperation(index);
@@ -121,19 +128,6 @@ void DesktopBackgroundController::CancelPendingWallpaperOperation() {
weak_ptr_factory_.InvalidateWeakPtrs();
}
-void DesktopBackgroundController::SetLoggedInUserWallpaper() {
- int index = Shell::GetInstance()->user_wallpaper_delegate()->
- GetUserWallpaperIndex();
- // We should not change background when index is invalid. For instance, at
- // login screen or stub_user login.
- if (index == ash::GetInvalidWallpaperIndex()) {
- CreateEmptyWallpaper();
- return;
- }
-
- SetDefaultWallpaper(index);
-}
-
void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode() {
// Set a solid black background.
// TODO(derat): Remove this in favor of having the compositor only clear the

Powered by Google App Engine
This is Rietveld 408576698