summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 16:18:51 +0000
committerbshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 16:18:51 +0000
commite7ace3c7a13eecee1e757d22a70dd0ce4eb5b672 (patch)
treed7b2bd6ce0599bb95032b15ad866f6e02b31c43e /ash/desktop_background
parent7b7e0b30cd44d9d714032a6f4e51d3963951731e (diff)
downloadchromium_src-e7ace3c7a13eecee1e757d22a70dd0ce4eb5b672.zip
chromium_src-e7ace3c7a13eecee1e757d22a70dd0ce4eb5b672.tar.gz
chromium_src-e7ace3c7a13eecee1e757d22a70dd0ce4eb5b672.tar.bz2
Invalidate all wallpaper cache if display configuration changed
BUG=350406 Review URL: https://codereview.chromium.org/190993003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller.cc2
-rw-r--r--ash/desktop_background/user_wallpaper_delegate.h9
2 files changed, 8 insertions, 3 deletions
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index daf104e..7673f29 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -448,7 +448,7 @@ void DesktopBackgroundController::UpdateWallpaper() {
current_default_wallpaper_path_ = base::FilePath();
current_default_wallpaper_resource_id_ = -1;
ash::Shell::GetInstance()->user_wallpaper_delegate()->
- UpdateWallpaper();
+ UpdateWallpaper(true /* clear cache */);
}
// static
diff --git a/ash/desktop_background/user_wallpaper_delegate.h b/ash/desktop_background/user_wallpaper_delegate.h
index 16f2cf7..5e47ec0 100644
--- a/ash/desktop_background/user_wallpaper_delegate.h
+++ b/ash/desktop_background/user_wallpaper_delegate.h
@@ -30,8 +30,13 @@ class ASH_EXPORT UserWallpaperDelegate {
virtual bool ShouldShowInitialAnimation() = 0;
// Updates current wallpaper. It may switch the size of wallpaper based on the
- // current display's resolution.
- virtual void UpdateWallpaper() = 0;
+ // current display's resolution. If |clear_cache| is true, all wallpaper
+ // cache should be cleared. This is required when the display's native
+ // resolution changes to a larger resolution (e.g. when hooked up a large
+ // external display) and we need to load a larger resolution wallpaper for the
+ // large display. All the previous small resolution wallpaper cache should be
+ // cleared.
+ virtual void UpdateWallpaper(bool clear_cache) = 0;
// Initialize wallpaper.
virtual void InitializeWallpaper() = 0;