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

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: Address review and fix a segfault when starting chrome after saving data to local state. 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..d8af460b9aec46de6d7b8caec390f7be06268ebf 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -21,24 +21,24 @@
namespace ash {
DesktopBackgroundController::DesktopBackgroundController() :
- previous_wallpaper_index_(GetDefaultWallpaperIndex()),
desktop_background_mode_(BACKGROUND_IMAGE) {
}
DesktopBackgroundController::~DesktopBackgroundController() {
}
-void DesktopBackgroundController::OnDesktopBackgroundChanged(int index) {
+void DesktopBackgroundController::OnDesktopBackgroundChanged() {
internal::RootWindowLayoutManager* root_window_layout =
Shell::GetInstance()->root_window_layout();
if (desktop_background_mode_ == BACKGROUND_SOLID_COLOR)
return;
+ int index = Shell::GetInstance()->user_wallpaper_delegate()->
+ GetUserWallpaperIndex();
DCHECK(root_window_layout->background_widget()->widget_delegate());
static_cast<internal::DesktopBackgroundView*>(
root_window_layout->background_widget()->widget_delegate())->
SetWallpaper(GetWallpaper(index));
- previous_wallpaper_index_ = index;
}
void DesktopBackgroundController::SetDesktopBackgroundImageMode(
@@ -51,14 +51,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