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

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

Issue 2772313004: [ash-md] WIP Added wallpaper color caching. (Closed)
Patch Set: "Working'ish" prototype Created 3 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/users/wallpaper/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
index 823b4604992f3093eb10fae332db6948a66b4289..85be10a01946bfb44af1623a875159a660d226f9 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -49,6 +49,7 @@
#include "components/user_manager/known_user.h"
#include "components/user_manager/user_names.h"
#include "components/user_manager/user_type.h"
+#include "components/wallpaper/pref_based_wallpaper_color_cache.h"
#include "components/wallpaper/wallpaper_files_id.h"
#include "components/wallpaper/wallpaper_layout.h"
#include "content/public/browser/browser_thread.h"
@@ -388,6 +389,11 @@ WallpaperManager::~WallpaperManager() {
device_wallpaper_image_subscription_.reset();
user_manager::UserManager::Get()->RemoveSessionStateObserver(this);
weak_factory_.InvalidateWeakPtrs();
+
+ if (wallpaper_color_cache_) {
+ ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache(
jonross 2017/03/28 14:33:27 This pattern is the older method of having chrome
+ nullptr);
+ }
}
// static
@@ -473,6 +479,7 @@ void WallpaperManager::InitializeWallpaper() {
// Zero delays is also set in autotests.
if (WizardController::IsZeroDelayEnabled()) {
// Ensure tests have some sort of wallpaper.
+ // Foobar();
ash::Shell::GetInstance()->wallpaper_controller()->CreateEmptyWallpaper();
return;
}
@@ -1368,6 +1375,7 @@ void WallpaperManager::SetDefaultWallpaperPath(
default_small_wallpaper_file_ = default_small_wallpaper_file;
default_large_wallpaper_file_ = default_large_wallpaper_file;
+ // Foobar();
ash::WallpaperController* controller =
ash::Shell::GetInstance()->wallpaper_controller();
@@ -1413,4 +1421,23 @@ void WallpaperManager::RecordWallpaperAppType() {
WALLPAPERS_APPS_NUM);
}
+// void WallpaperManager::Foobar() {
+// // TODO(bruthig): Install a color cache in Mash.
+// LOG(ERROR) << " *** " << __FUNCTION__ << "() line=" << __LINE__ << "
+// HERE!!!"; static int count = 0; if (count <= 0) {
+// ++count;
+// LOG(ERROR) << " *** " << __FUNCTION__ << "() line=" << __LINE__ << "
+// Installed"; wallpaper_color_cache_ =
+// base::MakeUnique<wallpaper::PrefBasedWallpaperColorCache>(
+// g_browser_process->local_state());
+// ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache(
+// wallpaper_color_cache_.get());
+// } else {
+
+// LOG(ERROR) << " *** " << __FUNCTION__ << "() line=" << __LINE__ << "
+// ash_util::IsRunningInMash()=" << ash_util::IsRunningInMash() << "
+// ash::Shell::HasInstance()=" << ash::Shell::HasInstance();
+// }
+// }
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698