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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10827154: Preload default wallpaper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nikita's reivew Created 8 years, 4 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: 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 022ca0ba0c796d47753b6536e39bc8dac85d94e0..d311636706d29d531166d8f8d3af586faa32ecbe 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -134,6 +134,18 @@ void DesktopBackgroundController::OnRootWindowAdded(
}
}
+void DesktopBackgroundController::TriggerCacheDefaultWallpaper(int index) {
+ if (index == ash::GetInvalidWallpaperIndex() ||
Nikita (slow) 2012/08/06 16:36:01 just check for index < 0 ?
bshe 2012/08/07 15:18:57 I was trying to avoid magic number like 0. But i a
+ index == ash::GetSolidColorIndex())
+ return;
+ scoped_refptr<WallpaperOperation> wallpaper_op =
+ new WallpaperOperation(index);
+ base::WorkerPool::PostTask(
+ FROM_HERE,
+ base::Bind(&WallpaperOperation::Run, wallpaper_op),
+ true);
+}
+
void DesktopBackgroundController::SetDefaultWallpaper(int index) {
// We should not change background when index is invalid. For instance, at
// login screen or stub_user login.

Powered by Google App Engine
This is Rietveld 408576698