Index: ash/desktop_background/desktop_background_controller.cc |
=================================================================== |
--- ash/desktop_background/desktop_background_controller.cc (revision 150736) |
+++ ash/desktop_background/desktop_background_controller.cc (working copy) |
@@ -151,18 +151,6 @@ |
InstallComponent(root_window); |
} |
-void DesktopBackgroundController::CacheDefaultWallpaper(int index) { |
- DCHECK(index >= 0); |
- |
- WallpaperResolution resolution = GetAppropriateResolution(); |
- scoped_refptr<WallpaperOperation> wallpaper_op = |
- new WallpaperOperation(index, resolution); |
- base::WorkerPool::PostTask( |
- FROM_HERE, |
- base::Bind(&WallpaperOperation::Run, wallpaper_op), |
- true); |
-} |
- |
void DesktopBackgroundController::SetDefaultWallpaper(int index, |
bool force_reload) { |
// We should not change background when index is invalid. For instance, at |
@@ -181,7 +169,15 @@ |
CancelPendingWallpaperOperation(); |
- WallpaperResolution resolution = GetAppropriateResolution(); |
+ WallpaperResolution resolution = SMALL; |
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
+ for (Shell::RootWindowList::iterator iter = root_windows.begin(); |
+ iter != root_windows.end(); ++iter) { |
+ gfx::Size root_window_size = (*iter)->GetHostSize(); |
+ if (root_window_size.width() > kSmallWallpaperMaximalWidth || |
+ root_window_size.height() > kSmallWallpaperMaximalHeight) |
+ resolution = LARGE; |
+ } |
wallpaper_op_ = new WallpaperOperation(index, resolution); |
base::WorkerPool::PostTaskAndReply( |
@@ -359,17 +355,4 @@ |
internal::kShellWindowId_DesktopBackgroundContainer; |
} |
-WallpaperResolution DesktopBackgroundController::GetAppropriateResolution() { |
- WallpaperResolution resolution = SMALL; |
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
- for (Shell::RootWindowList::iterator iter = root_windows.begin(); |
- iter != root_windows.end(); ++iter) { |
- gfx::Size root_window_size = (*iter)->GetHostSize(); |
- if (root_window_size.width() > kSmallWallpaperMaximalWidth || |
- root_window_size.height() > kSmallWallpaperMaximalHeight) |
- resolution = LARGE; |
- } |
- return resolution; |
-} |
- |
} // namespace ash |