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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 9764012: Restore to user selected wallpaper after browser crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 cc4e017179742f972520b9ba361e3e3c960803ca..5d23e5dcd2fc0ba87259b2a31714afdb892ab492 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -21,7 +21,6 @@
namespace ash {
DesktopBackgroundController::DesktopBackgroundController() :
- previous_wallpaper_index_(GetDefaultWallpaperIndex()),
desktop_background_mode_(BACKGROUND_IMAGE) {
}
@@ -38,7 +37,12 @@ void DesktopBackgroundController::OnDesktopBackgroundChanged(int index) {
static_cast<internal::DesktopBackgroundView*>(
root_window_layout->background_widget()->widget_delegate())->
SetWallpaper(GetWallpaper(index));
- previous_wallpaper_index_ = index;
+}
+
+void DesktopBackgroundController::OnUserLoginOrSwitchToImageMode() {
flackr 2012/03/21 17:44:20 Rather than adding this method, how about changing
bshe 2012/03/22 02:16:03 Done. On 2012/03/21 17:44:20, flackr wrote:
+ int index = Shell::GetInstance()->user_wallpaper_delegate()->
+ GetUserWallpaperIndex();
+ OnDesktopBackgroundChanged(index);
}
void DesktopBackgroundController::SetDesktopBackgroundImageMode(
@@ -51,14 +55,6 @@ void DesktopBackgroundController::SetDesktopBackgroundImageMode(
desktop_background_mode_ = BACKGROUND_IMAGE;
}
-void DesktopBackgroundController::SetDefaultDesktopBackgroundImage() {
- SetDesktopBackgroundImageMode(GetWallpaper(GetDefaultWallpaperIndex()));
-}
-
-void DesktopBackgroundController::SetPreviousDesktopBackgroundImage() {
- SetDesktopBackgroundImageMode(GetWallpaper(previous_wallpaper_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