| Index: chrome/browser/chromeos/login/wallpaper_manager.cc
|
| diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
|
| index 95a3cb5f4a3498fe6ac4e9d9d5c225c94e8de110..7f6db2cae7d59ce714e96cdf156e10046fa80e60 100644
|
| --- a/chrome/browser/chromeos/login/wallpaper_manager.cc
|
| +++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
|
| @@ -4,7 +4,8 @@
|
|
|
| #include "chrome/browser/chromeos/login/wallpaper_manager.h"
|
|
|
| -#include "ash/desktop_background/desktop_background_resources.h"
|
| +#include "ash/desktop_background/desktop_background_controller.h"
|
| +#include "ash/shell.h"
|
| #include "base/logging.h"
|
| #include "base/time.h"
|
| #include "base/values.h"
|
| @@ -25,7 +26,9 @@ namespace chromeos {
|
|
|
| static WallpaperManager* g_wallpaper_manager = NULL;
|
|
|
| -WallpaperManager::WallpaperManager() : last_selected_user_("") {
|
| +WallpaperManager::WallpaperManager()
|
| + : ALLOW_THIS_IN_INITIALIZER_LIST(image_loader_(new UserImageLoader)),
|
| + last_selected_user_("") {
|
| system::TimezoneSettings::GetInstance()->AddObserver(this);
|
| RestartTimer();
|
| }
|
| @@ -60,6 +63,15 @@ void WallpaperManager::RestartTimer() {
|
| }
|
| }
|
|
|
| +void WallpaperManager::SetWallpaperFromFile(std::string email,
|
| + const std::string& path,
|
| + ash::WallpaperLayout layout) {
|
| + image_loader_->Start(
|
| + path, 0, false,
|
| + base::Bind(&WallpaperManager::OnCustomWallpaperLoaded,
|
| + base::Unretained(this), email, layout));
|
| +}
|
| +
|
| void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) {
|
| RestartTimer();
|
| }
|
| @@ -68,6 +80,14 @@ void WallpaperManager::SystemResumed() {
|
| BatchUpdateWallpaper();
|
| }
|
|
|
| +void WallpaperManager::OnCustomWallpaperLoaded(const std::string& email,
|
| + ash::WallpaperLayout layout,
|
| + const UserImage& user_image) {
|
| + const SkBitmap& wallpaper = user_image.image();
|
| + ash::Shell::GetInstance()->desktop_background_controller()->
|
| + SetCustomWallpaper(wallpaper, layout);
|
| +}
|
| +
|
| void WallpaperManager::BatchUpdateWallpaper() {
|
| PrefService* local_state = g_browser_process->local_state();
|
| UserManager* user_manager = UserManager::Get();
|
|
|