diff options
author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 18:22:23 +0000 |
---|---|---|
committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 18:22:23 +0000 |
commit | d2b09c6c1166330bfbfb841f27f8b4aa8312d325 (patch) | |
tree | 7fa19b033181d407f4ccc9fcf624cd33c75b37e5 /ash/desktop_background | |
parent | d7db4f62b576074b5b5f62d156e335855dc51bdb (diff) | |
download | chromium_src-d2b09c6c1166330bfbfb841f27f8b4aa8312d325.zip chromium_src-d2b09c6c1166330bfbfb841f27f8b4aa8312d325.tar.gz chromium_src-d2b09c6c1166330bfbfb841f27f8b4aa8312d325.tar.bz2 |
Revert 140312 - 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
TBR=bshe@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10511014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r-- | ash/desktop_background/desktop_background_controller.cc | 20 | ||||
-rw-r--r-- | ash/desktop_background/desktop_background_controller.h | 9 |
2 files changed, 19 insertions, 10 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc index 31be9c8..5994bf2 100644 --- a/ash/desktop_background/desktop_background_controller.cc +++ b/ash/desktop_background/desktop_background_controller.cc @@ -102,13 +102,6 @@ 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); @@ -138,6 +131,19 @@ 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 7e8620b..b0ae8cf 100644 --- a/ash/desktop_background/desktop_background_controller.h +++ b/ash/desktop_background/desktop_background_controller.h @@ -25,9 +25,8 @@ class UserWallpaperDelegate { public: virtual ~UserWallpaperDelegate() {} - // Loads logged in user wallpaper asynchronously and sets to current wallpaper - // after loaded. - virtual void SetLoggedInUserWallpaper() = 0; + // Gets the index of user selected wallpaper. + virtual const int GetUserWallpaperIndex() = 0; // Opens the set wallpaper page in the browser. virtual void OpenSetWallpaperPage() = 0; @@ -66,6 +65,10 @@ 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(); |