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

Unified Diff: components/favicon_base/fallback_icon_style.cc

Issue 2374753002: Track when fallback icon color is the default. (Closed)
Patch Set: Merge branch 'refs/heads/master' into default-color Created 4 years, 2 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 | « components/favicon_base/fallback_icon_style.h ('k') | components/favicon_base/fallback_icon_url_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon_base/fallback_icon_style.cc
diff --git a/components/favicon_base/fallback_icon_style.cc b/components/favicon_base/fallback_icon_style.cc
index 66ee5997e51ba43c91db55df0ff4cdef031f440a..cbb478b1a175ed7993e735a2b4a16255e1c454b7 100644
--- a/components/favicon_base/fallback_icon_style.cc
+++ b/components/favicon_base/fallback_icon_style.cc
@@ -34,19 +34,20 @@ const double kDefaultRoundness = 0; // Square. Round corners are applied
FallbackIconStyle::FallbackIconStyle()
: background_color(kDefaultBackgroundColor),
+ is_default_background_color(true),
text_color(kDefaultTextColorLight),
font_size_ratio(kDefaultFontSizeRatio),
- roundness(kDefaultRoundness) {
-}
+ roundness(kDefaultRoundness) {}
FallbackIconStyle::~FallbackIconStyle() {
}
bool FallbackIconStyle::operator==(const FallbackIconStyle& other) const {
return background_color == other.background_color &&
- text_color == other.text_color &&
- font_size_ratio == other.font_size_ratio &&
- roundness == other.roundness;
+ is_default_background_color == other.is_default_background_color &&
+ text_color == other.text_color &&
+ font_size_ratio == other.font_size_ratio &&
+ roundness == other.roundness;
}
void MatchFallbackIconTextColorAgainstBackgroundColor(
@@ -80,6 +81,7 @@ void SetDominantColorAsBackground(
color_hsl.l = std::min(color_hsl.l, kMaxBackgroundColorLightness);
style->background_color =
color_utils::HSLToSkColor(color_hsl, SK_AlphaOPAQUE);
+ style->is_default_background_color = false;
}
} // namespace favicon_base
« no previous file with comments | « components/favicon_base/fallback_icon_style.h ('k') | components/favicon_base/fallback_icon_url_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698