diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 20:08:24 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 20:08:24 +0000 |
commit | 3e9589a8bcdb2682ef0c78343b42133a3729079c (patch) | |
tree | 614f1b1743b730b24c2caf1b2be04fef4b1a96ef /ash | |
parent | 6316fb08020556639cedc83d02b7d23014f96029 (diff) | |
download | chromium_src-3e9589a8bcdb2682ef0c78343b42133a3729079c.zip chromium_src-3e9589a8bcdb2682ef0c78343b42133a3729079c.tar.gz chromium_src-3e9589a8bcdb2682ef0c78343b42133a3729079c.tar.bz2 |
Convert built-in wallpaper in chrome binary to local files in disk.
This CL does the following:
1. Rename experimental wallpaper flag to new wallpaper flag.
2. When user turned on new wallpaper flag:
a) if the user is using a build in wallpaper, copy that wallpaper to local disk.
Then save the information to a new wallpaper pref in local state.
b) if the user is using a custom wallpaper, save information to a new wallpaper
pref in local state.
3. Make GetAppropriateResolution in desktop background controller public so we can use it when converting
4. Added a new wallpaper type ONLINE, for all wallpapers which downloaded from gstatic.
BUG=141427
Review URL: https://chromiumcodereview.appspot.com/10824408
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/desktop_background/desktop_background_controller.cc | 26 | ||||
-rw-r--r-- | ash/desktop_background/desktop_background_controller.h | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc index 6edd440..83b486c 100644 --- a/ash/desktop_background/desktop_background_controller.cc +++ b/ash/desktop_background/desktop_background_controller.cc @@ -222,6 +222,19 @@ void DesktopBackgroundController::CreateEmptyWallpaper() { SetDesktopBackgroundImageMode(); } +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; +} + void DesktopBackgroundController::MoveDesktopToLockedContainer() { if (locked_) return; @@ -349,17 +362,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 156baff..3d2c919 100644 --- a/ash/desktop_background/desktop_background_controller.h +++ b/ash/desktop_background/desktop_background_controller.h @@ -107,6 +107,9 @@ class ASH_EXPORT DesktopBackgroundController : public aura::WindowObserver { // is SystemGestureEventFilterTest.ThreeFingerSwipe. void CreateEmptyWallpaper(); + // Returns the appropriate wallpaper resolution for all root windows. + WallpaperResolution GetAppropriateResolution(); + // Move all desktop widgets to locked container. void MoveDesktopToLockedContainer(); @@ -150,9 +153,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(); - // Send notification that background animation finished. void NotifyAnimationFinished(); |