summaryrefslogtreecommitdiffstats
path: root/ash
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
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')
-rw-r--r--ash/default_user_wallpaper_delegate.cc2
-rw-r--r--ash/default_user_wallpaper_delegate.h2
-rw-r--r--ash/desktop_background/desktop_background_controller.cc2
-rw-r--r--ash/desktop_background/user_wallpaper_delegate.h9
-rw-r--r--ash/test/test_user_wallpaper_delegate.cc4
-rw-r--r--ash/test/test_user_wallpaper_delegate.h2
6 files changed, 13 insertions, 8 deletions
diff --git a/ash/default_user_wallpaper_delegate.cc b/ash/default_user_wallpaper_delegate.cc
index 99c1d58..c6a5587e 100644
--- a/ash/default_user_wallpaper_delegate.cc
+++ b/ash/default_user_wallpaper_delegate.cc
@@ -26,7 +26,7 @@ bool DefaultUserWallpaperDelegate::ShouldShowInitialAnimation() {
return false;
}
-void DefaultUserWallpaperDelegate::UpdateWallpaper() {
+void DefaultUserWallpaperDelegate::UpdateWallpaper(bool clear_cache) {
}
void DefaultUserWallpaperDelegate::InitializeWallpaper() {
diff --git a/ash/default_user_wallpaper_delegate.h b/ash/default_user_wallpaper_delegate.h
index 9978738..ad7da6c 100644
--- a/ash/default_user_wallpaper_delegate.h
+++ b/ash/default_user_wallpaper_delegate.h
@@ -23,7 +23,7 @@ class ASH_EXPORT DefaultUserWallpaperDelegate : public UserWallpaperDelegate {
virtual void SetAnimationDurationOverride(
int animation_duration_in_ms) OVERRIDE;
virtual bool ShouldShowInitialAnimation() OVERRIDE;
- virtual void UpdateWallpaper() OVERRIDE;
+ virtual void UpdateWallpaper(bool clear_cache) OVERRIDE;
virtual void InitializeWallpaper() OVERRIDE;
virtual void OpenSetWallpaperPage() OVERRIDE;
virtual bool CanOpenSetWallpaperPage() OVERRIDE;
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;
diff --git a/ash/test/test_user_wallpaper_delegate.cc b/ash/test/test_user_wallpaper_delegate.cc
index cbf1e9a..24ab287e 100644
--- a/ash/test/test_user_wallpaper_delegate.cc
+++ b/ash/test/test_user_wallpaper_delegate.cc
@@ -15,8 +15,8 @@ TestUserWallpaperDelegate::TestUserWallpaperDelegate()
TestUserWallpaperDelegate::~TestUserWallpaperDelegate() {}
-void TestUserWallpaperDelegate::UpdateWallpaper() {
- DefaultUserWallpaperDelegate::UpdateWallpaper();
+void TestUserWallpaperDelegate::UpdateWallpaper(bool clear_cache) {
+ DefaultUserWallpaperDelegate::UpdateWallpaper(clear_cache);
if (!custom_wallpaper_.isNull()) {
Shell::GetInstance()->desktop_background_controller()->SetCustomWallpaper(
custom_wallpaper_, WALLPAPER_LAYOUT_STRETCH);
diff --git a/ash/test/test_user_wallpaper_delegate.h b/ash/test/test_user_wallpaper_delegate.h
index 83c2583..aa92861 100644
--- a/ash/test/test_user_wallpaper_delegate.h
+++ b/ash/test/test_user_wallpaper_delegate.h
@@ -22,7 +22,7 @@ class TestUserWallpaperDelegate : public DefaultUserWallpaperDelegate {
}
// DefaultUserWallpaperDelegate overrides:
- virtual void UpdateWallpaper() OVERRIDE;
+ virtual void UpdateWallpaper(bool clear_cache) OVERRIDE;
// Returns and clears |update_wallpaper_count_|.
int GetUpdateWallpaperCountAndReset();