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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 215293003: Move all wallpaper file loading and decoding from DesktopBackgroundController to WallpaperManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 6 years, 8 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/chromeos/extensions/wallpaper_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index fa4c567d0b084d38aa34efcf51a8b9f4a32d8fb6..5a58f082cee9d0a2775693087ac68306427f43f5 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -293,15 +293,15 @@ bool WallpaperPrivateSetWallpaperIfExistsFunction::RunImpl() {
base::FilePath wallpaper_path;
base::FilePath fallback_path;
- ash::WallpaperResolution resolution = ash::Shell::GetInstance()->
- desktop_background_controller()->GetAppropriateResolution();
+ chromeos::WallpaperManager::WallpaperResolution resolution =
+ chromeos::WallpaperManager::GetAppropriateResolution();
std::string file_name = GURL(params->url).ExtractFileName();
CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPERS,
&wallpaper_path));
fallback_path = wallpaper_path.Append(file_name);
if (params->layout != wallpaper_private::WALLPAPER_LAYOUT_STRETCH &&
- resolution == ash::WALLPAPER_RESOLUTION_SMALL) {
+ resolution == chromeos::WallpaperManager::WALLPAPER_RESOLUTION_SMALL) {
file_name = base::FilePath(file_name).InsertBeforeExtension(
chromeos::kSmallWallpaperSuffix).value();
}
@@ -444,8 +444,9 @@ void WallpaperPrivateSetWallpaperFunction::SaveToFile() {
wallpaper,
file_path,
ash::WALLPAPER_LAYOUT_CENTER_CROPPED,
- ash::kSmallWallpaperMaxWidth,
- ash::kSmallWallpaperMaxHeight);
+ chromeos::kSmallWallpaperMaxWidth,
+ chromeos::kSmallWallpaperMaxHeight,
+ NULL);
} else {
std::string error = base::StringPrintf(
"Failed to create/write wallpaper to %s.", file_name.c_str());
@@ -586,9 +587,10 @@ void WallpaperPrivateSetCustomWallpaperFunction::GenerateThumbnail(
chromeos::WallpaperManager::Get()->ResizeWallpaper(
wallpaper,
ash::WALLPAPER_LAYOUT_STRETCH,
- ash::kWallpaperThumbnailWidth,
- ash::kWallpaperThumbnailHeight,
- &data);
+ chromeos::kWallpaperThumbnailWidth,
+ chromeos::kWallpaperThumbnailHeight,
+ &data,
+ NULL);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(

Powered by Google App Engine
This is Rietveld 408576698