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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 1131243006: Get rid of the huge delay in background resize during rotation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_controller.cc
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index 7019e41acfdd83729e59a0421d1ab188dbc71ed7..ed7414eaff178fa6aa8207a67c24d776e145a263 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -45,7 +45,7 @@ namespace {
// How long to wait reloading the wallpaper after the max display has
// changed?
-const int kWallpaperReloadDelayMs = 2000;
+const int kWallpaperReloadDelayMs = 100;
} // namespace
@@ -136,8 +136,8 @@ void DesktopBackgroundController::OnDisplayConfigurationChanged() {
timer_.Stop();
timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(wallpaper_reload_delay_),
- this,
- &DesktopBackgroundController::UpdateWallpaper);
+ base::Bind(&DesktopBackgroundController::UpdateWallpaper,
+ base::Unretained(this), false /* clear cache */));
oshima 2015/05/12 22:36:23 Sorry if I wasn't clear. We shouldn't need any del
}
}
}
@@ -153,7 +153,7 @@ void DesktopBackgroundController::OnRootWindowAdded(aura::Window* root_window) {
current_max_display_size_ = max_display_size;
if (desktop_background_mode_ == BACKGROUND_IMAGE &&
current_wallpaper_.get())
- UpdateWallpaper();
+ UpdateWallpaper(true /* clear cache */);
}
InstallDesktopController(root_window);
@@ -275,10 +275,10 @@ int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
: kShellWindowId_DesktopBackgroundContainer;
}
-void DesktopBackgroundController::UpdateWallpaper() {
+void DesktopBackgroundController::UpdateWallpaper(bool clear_cache) {
current_wallpaper_.reset(NULL);
- ash::Shell::GetInstance()->user_wallpaper_delegate()->
- UpdateWallpaper(true /* clear cache */);
+ ash::Shell::GetInstance()->user_wallpaper_delegate()->UpdateWallpaper(
+ clear_cache);
}
} // namespace ash
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698