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 730558696d93d2ce82e7a7dcb78b172c32d568d2..8cb0128178d32f0199a9b867c2f58cd5f5ccd392 100644 |
--- a/ash/desktop_background/desktop_background_controller.cc |
+++ b/ash/desktop_background/desktop_background_controller.cc |
@@ -161,11 +161,13 @@ DesktopBackgroundController::DesktopBackgroundController() |
weak_ptr_factory_(this), |
wallpaper_reload_delay_(kWallpaperReloadDelayMs) { |
Shell::GetInstance()->display_controller()->AddObserver(this); |
+ Shell::GetInstance()->AddShellObserver(this); |
} |
DesktopBackgroundController::~DesktopBackgroundController() { |
CancelDefaultWallpaperLoader(); |
Shell::GetInstance()->display_controller()->RemoveObserver(this); |
+ Shell::GetInstance()->RemoveShellObserver(this); |
} |
gfx::ImageSkia DesktopBackgroundController::GetWallpaper() const { |
@@ -190,23 +192,6 @@ WallpaperLayout DesktopBackgroundController::GetWallpaperLayout() const { |
return WALLPAPER_LAYOUT_CENTER_CROPPED; |
} |
-void DesktopBackgroundController::OnRootWindowAdded(aura::Window* root_window) { |
- // The background hasn't been set yet. |
- if (desktop_background_mode_ == BACKGROUND_NONE) |
- return; |
- |
- // Handle resolution change for "built-in" images. |
- gfx::Size max_display_size = GetMaxDisplaySizeInNative(); |
- if (current_max_display_size_ != max_display_size) { |
- current_max_display_size_ = max_display_size; |
- if (desktop_background_mode_ == BACKGROUND_IMAGE && |
- current_wallpaper_.get()) |
- UpdateWallpaper(); |
- } |
- |
- InstallDesktopController(root_window); |
-} |
- |
bool DesktopBackgroundController::SetDefaultWallpaper(bool is_guest) { |
VLOG(1) << "SetDefaultWallpaper: is_guest=" << is_guest; |
const bool use_large = |
@@ -327,6 +312,23 @@ void DesktopBackgroundController::OnDisplayConfigurationChanged() { |
} |
} |
+void DesktopBackgroundController::OnRootWindowAdded(aura::Window* root_window) { |
+ // The background hasn't been set yet. |
+ if (desktop_background_mode_ == BACKGROUND_NONE) |
+ return; |
+ |
+ // Handle resolution change for "built-in" images. |
+ gfx::Size max_display_size = GetMaxDisplaySizeInNative(); |
+ if (current_max_display_size_ != max_display_size) { |
+ current_max_display_size_ = max_display_size; |
+ if (desktop_background_mode_ == BACKGROUND_IMAGE && |
+ current_wallpaper_.get()) |
+ UpdateWallpaper(); |
+ } |
+ |
+ InstallDesktopController(root_window); |
+} |
+ |
bool DesktopBackgroundController::DefaultWallpaperIsAlreadyLoadingOrLoaded( |
const base::FilePath& image_file, |
int image_resource_id) const { |