summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 05:20:26 +0000
committerjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 05:20:26 +0000
commit644fc45545e5e991c8d1224454e1d287aef4b800 (patch)
tree0b936aa4f191f3bd7bc81acb6fe7d8e62c946721 /ash/desktop_background
parent64c8669b4b57939651b4578437bee65a0ed225b1 (diff)
downloadchromium_src-644fc45545e5e991c8d1224454e1d287aef4b800.zip
chromium_src-644fc45545e5e991c8d1224454e1d287aef4b800.tar.gz
chromium_src-644fc45545e5e991c8d1224454e1d287aef4b800.tar.bz2
Revert 150726 - Preload default wallpaper.
BUG=139929 Review URL: https://chromiumcodereview.appspot.com/10827154 TBR=bshe@chromium.org Review URL: https://chromiumcodereview.appspot.com/10854061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller.cc35
-rw-r--r--ash/desktop_background/desktop_background_controller.h8
2 files changed, 9 insertions, 34 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index 2d49b4d..51c2d29 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -151,18 +151,6 @@ void DesktopBackgroundController::OnRootWindowAdded(
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 @@ void DesktopBackgroundController::SetDefaultWallpaper(int index,
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 @@ int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
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
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index edcd803..ec9fcab 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -76,11 +76,6 @@ class ASH_EXPORT DesktopBackgroundController : public aura::WindowObserver {
// Initialize root window's background.
void OnRootWindowAdded(aura::RootWindow* root_window);
- // Loads default wallpaper at |index| asynchronously but does not set the
- // loaded image to current wallpaper. Resource bundle will cache the loaded
- // image.
- void CacheDefaultWallpaper(int index);
-
// Loads default wallpaper at |index| asynchronously and sets to current
// wallpaper after loaded. When |force_reload| is true, reload wallpaper
// for all root windows even if |index| is the same as current wallpaper. It
@@ -150,9 +145,6 @@ class ASH_EXPORT DesktopBackgroundController : public aura::WindowObserver {
// Returns id for background container for unlocked and locked states.
int GetBackgroundContainerId(bool locked);
- // Returns the appropriate wallpaper resolution for all root windows.
- WallpaperResolution GetAppropriateResolution();
-
// Can change at runtime.
bool locked_;