summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 17:12:15 +0000
committerbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 17:12:15 +0000
commit2384eae998e1fe9d2a95ffd0005e5df2de2bd3b9 (patch)
treeb0608d1ecdb8217ba251b8e1757578205936bb75 /ash/desktop_background
parent0e8949526deeb30f20bf3fdaee1e010281f7504b (diff)
downloadchromium_src-2384eae998e1fe9d2a95ffd0005e5df2de2bd3b9.zip
chromium_src-2384eae998e1fe9d2a95ffd0005e5df2de2bd3b9.tar.gz
chromium_src-2384eae998e1fe9d2a95ffd0005e5df2de2bd3b9.tar.bz2
Load user custom wallpaper after browser crash.
BUG=129810 TEST= 1. Login 2. Set custom wallpaper for desktop background 3. Trigger a chrome crash (about://inducebrowsercrashforrealz) 4. Observe the desktop wallpaper 5. Go to "Set wallpaper" settings dialog and look for the custom added wallpaper thumbnail Verify that custom wallpaper restored after chrome crash. Review URL: https://chromiumcodereview.appspot.com/10459003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller.cc20
-rw-r--r--ash/desktop_background/desktop_background_controller.h9
2 files changed, 10 insertions, 19 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index 5994bf2..31be9c8 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -102,6 +102,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);
@@ -131,19 +138,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
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index b0ae8cf..7e8620b 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -25,8 +25,9 @@ class UserWallpaperDelegate {
public:
virtual ~UserWallpaperDelegate() {}
- // Gets the index of user selected wallpaper.
- virtual const int GetUserWallpaperIndex() = 0;
+ // Loads logged in user wallpaper asynchronously and sets to current wallpaper
+ // after loaded.
+ virtual void SetLoggedInUserWallpaper() = 0;
// Opens the set wallpaper page in the browser.
virtual void OpenSetWallpaperPage() = 0;
@@ -65,10 +66,6 @@ class ASH_EXPORT DesktopBackgroundController {
// Cancels the current wallpaper loading operation.
void CancelPendingWallpaperOperation();
- // Loads logged in user wallpaper asynchronously and sets to current wallpaper
- // after loaded.
- void SetLoggedInUserWallpaper();
-
// Sets the desktop background to solid color mode and creates a solid color
// layout.
void SetDesktopBackgroundSolidColorMode();