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

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

Issue 2943333003: Extracting more than one wallpaper prominent color (Closed)
Patch Set: UMA Created 3 years, 6 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 8621f3677fe6f02e5de8a42746d601f3f7e9dcc0..f0b55020e35d0d114a3b10d85564fe674bca896e 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -444,9 +444,11 @@ void WallpaperManager::CalculateProminentColor(const gfx::ImageSkia& image) {
color_calculator_.reset();
}
+ // TODO(warx): this color fetching should go through ash::WallpaperController.
+ color_utils::ColorProfiles color_profiles = {color_utils::ColorProfile(
+ color_utils::LumaRange::DARK, color_utils::SaturationRange::MUTED)};
color_calculator_ = base::MakeUnique<wallpaper::WallpaperColorCalculator>(
- image, color_utils::LumaRange::DARK, color_utils::SaturationRange::MUTED,
- task_runner_);
+ image, color_profiles, task_runner_);
color_calculator_->AddObserver(this);
if (!color_calculator_->StartCalculation()) {
color_calculator_->RemoveObserver(this);
@@ -944,7 +946,7 @@ void WallpaperManager::OnWindowDestroying(aura::Window* window) {
}
void WallpaperManager::OnColorCalculationComplete() {
- SkColor color = color_calculator_->prominent_color();
+ SkColor color = color_calculator_->prominent_colors()[0];
color_calculator_->RemoveObserver(this);
color_calculator_.reset();
if (prominent_color_ == color)

Powered by Google App Engine
This is Rietveld 408576698