Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: chrome/browser/chromeos/login/wallpaper_manager.cc

Issue 190993003: Invalidate all wallpaper cache if display configuration changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win compile Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
index 14cfbf3c22b0b5206cf5ea356b61a9500154d361..9c62567b5e8ebba223ccc35006079e52b4838459 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -289,8 +289,8 @@ void WallpaperManager::TestApi::SetWallpaperCache(const std::string& user_id,
wallpaper_manager_->wallpaper_cache_[user_id] = image;
}
-void WallpaperManager::TestApi::ClearWallpaperCache() {
- wallpaper_manager_->ClearWallpaperCache();
+void WallpaperManager::TestApi::ClearDisposableWallpaperCache() {
+ wallpaper_manager_->ClearDisposableWallpaperCache();
}
// static
@@ -370,7 +370,7 @@ void WallpaperManager::EnsureLoggedInUserWallpaperLoaded() {
SetUserWallpaperNow(UserManager::Get()->GetLoggedInUser()->email());
}
-void WallpaperManager::ClearWallpaperCache() {
+void WallpaperManager::ClearDisposableWallpaperCache() {
// Cancel callback for previous cache requests.
weak_factory_.InvalidateWeakPtrs();
if (!UserManager::IsMultipleProfilesAllowed()) {
@@ -467,7 +467,7 @@ void WallpaperManager::Observe(int type,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
switch (type) {
case chrome::NOTIFICATION_LOGIN_USER_CHANGED: {
- ClearWallpaperCache();
+ ClearDisposableWallpaperCache();
BrowserThread::PostDelayedTask(
BrowserThread::UI,
FROM_HERE,
@@ -828,8 +828,9 @@ void WallpaperManager::SetWallpaperFromImageSkia(
}
}
-void WallpaperManager::UpdateWallpaper() {
- ClearWallpaperCache();
+void WallpaperManager::UpdateWallpaper(bool clear_cache) {
+ if (clear_cache)
+ wallpaper_cache_.clear();
current_wallpaper_path_.clear();
// For GAIA login flow, the last_selected_user_ may not be set before user
// login. If UpdateWallpaper is called at GAIA login screen, no wallpaper will

Powered by Google App Engine
This is Rietveld 408576698