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 | |
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')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 8 | ||||
-rw-r--r-- | ash/desktop_background/desktop_background_controller.cc | 20 | ||||
-rw-r--r-- | ash/desktop_background/desktop_background_controller.h | 9 | ||||
-rw-r--r-- | ash/shell.cc | 5 |
4 files changed, 25 insertions, 17 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index c4f21ba..72a43ec 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -155,12 +155,10 @@ bool HandleToggleDesktopBackgroundMode() { ash::DesktopBackgroundController* desktop_background_controller = ash::Shell::GetInstance()->desktop_background_controller(); if (desktop_background_controller->desktop_background_mode() == - ash::DesktopBackgroundController::BACKGROUND_IMAGE) { + ash::DesktopBackgroundController::BACKGROUND_IMAGE) desktop_background_controller->SetDesktopBackgroundSolidColorMode(); - } else { - ash::Shell::GetInstance()->user_wallpaper_delegate()-> - SetLoggedInUserWallpaper(); - } + else + desktop_background_controller->SetLoggedInUserWallpaper(); return true; } 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(); diff --git a/ash/shell.cc b/ash/shell.cc index db7d6e6..9d667d8 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -244,7 +244,8 @@ class DummyUserWallpaperDelegate : public UserWallpaperDelegate { virtual ~DummyUserWallpaperDelegate() {} - virtual void SetLoggedInUserWallpaper() OVERRIDE { + virtual const int GetUserWallpaperIndex() OVERRIDE { + return -1; } virtual void OpenSetWallpaperPage() OVERRIDE { @@ -805,7 +806,7 @@ void Shell::Init() { // It needs to be created after OnWindowResized has been called, otherwise the // widget will not paint when restoring after a browser crash. - user_wallpaper_delegate_->SetLoggedInUserWallpaper(); + desktop_background_controller_->SetLoggedInUserWallpaper(); window_modality_controller_.reset(new internal::WindowModalityController); AddRootWindowEventFilter(window_modality_controller_.get()); |