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

Unified Diff: chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc

Issue 10832019: Speed up custom wallpaper switching time and wallpaper manager code refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 8 years, 5 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: chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc
diff --git a/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc b/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc
index 04a7219f2ca8ab826e0aeb4fef2ce48488ef045c..213745265b366f5ff281e98dbcbec860456ed1c4 100644
--- a/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handler.cc
@@ -14,6 +14,7 @@
#include "base/string_util.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chrome/browser/chromeos/login/wallpaper_manager.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
@@ -106,7 +107,7 @@ void SetWallpaperOptionsHandler::FileSelected(const FilePath& path,
UserManager* user_manager = UserManager::Get();
// Default wallpaper layout is CENTER_CROPPED.
- user_manager->SaveUserWallpaperFromFile(
+ WallpaperManager::Get()->SetUserWallpaperFromFile(
user_manager->GetLoggedInUser().email(), path, ash::CENTER_CROPPED,
weak_factory_.GetWeakPtr());
web_ui()->CallJavascriptFunction("SetWallpaperOptions.didSelectFile");
@@ -166,7 +167,8 @@ void SetWallpaperOptionsHandler::HandlePageShown(const base::ListValue* args) {
User::WallpaperType type;
int index;
base::Time date;
- UserManager::Get()->GetLoggedInUserWallpaperProperties(&type, &index, &date);
+ WallpaperManager::Get()->GetLoggedInUserWallpaperProperties(
+ &type, &index, &date);
if (type == User::DAILY && date != base::Time::Now().LocalMidnight()) {
index = ash::GetNextWallpaperIndex(index);
UserManager::Get()->SaveLoggedInUserWallpaperProperties(User::DAILY,
@@ -240,7 +242,8 @@ void SetWallpaperOptionsHandler::HandleDailyWallpaper(const ListValue* args) {
User::WallpaperType type;
int index;
base::Time date;
- UserManager::Get()->GetLoggedInUserWallpaperProperties(&type, &index, &date);
+ WallpaperManager::Get()->GetLoggedInUserWallpaperProperties(
+ &type, &index, &date);
if (date != base::Time::Now().LocalMidnight())
index = ash::GetNextWallpaperIndex(index);
UserManager::Get()->SaveLoggedInUserWallpaperProperties(User::DAILY, index);

Powered by Google App Engine
This is Rietveld 408576698