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

Unified Diff: components/favicon_base/fallback_icon_style.cc

Issue 2883053003: Delete unused chrome://fallback-icon/ handling (Closed)
Patch Set: Merge branch 'searchbox2' into searchbox3 Created 3 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
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 cbb478b1a175ed7993e735a2b4a16255e1c454b7..917fb7ca6e4f01d18ac13372c9ee4f9382542db8 100644
--- a/components/favicon_base/fallback_icon_style.cc
+++ b/components/favicon_base/fallback_icon_style.cc
@@ -13,10 +13,6 @@ namespace favicon_base {
namespace {
-// Luma threshold for background color determine whether to use dark or light
-// text color.
-const uint8_t kDarkTextLumaThreshold = 190;
-
// The maximum lightness of the background color to ensure light text is
// readable.
const double kMaxBackgroundColorLightness = 0.67;
@@ -24,42 +20,19 @@ const double kMinBackgroundColorLightness = 0.15;
// Default values for FallbackIconStyle.
const SkColor kDefaultBackgroundColor = SkColorSetRGB(0x78, 0x78, 0x78);
-const SkColor kDefaultTextColorDark = SK_ColorBLACK;
-const SkColor kDefaultTextColorLight = SK_ColorWHITE;
-const double kDefaultFontSizeRatio = 0.44;
-const double kDefaultRoundness = 0; // Square. Round corners are applied
- // externally (Javascript or Java).
} // namespace
FallbackIconStyle::FallbackIconStyle()
: background_color(kDefaultBackgroundColor),
- is_default_background_color(true),
- text_color(kDefaultTextColorLight),
- font_size_ratio(kDefaultFontSizeRatio),
- roundness(kDefaultRoundness) {}
+ is_default_background_color(true) {}
FallbackIconStyle::~FallbackIconStyle() {
}
bool FallbackIconStyle::operator==(const FallbackIconStyle& other) const {
return background_color == other.background_color &&
- 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(
- FallbackIconStyle* style) {
- const uint8_t luma = color_utils::GetLuma(style->background_color);
- style->text_color = (luma >= kDarkTextLumaThreshold) ?
- kDefaultTextColorDark : kDefaultTextColorLight;
-}
-
-bool ValidateFallbackIconStyle(const FallbackIconStyle& style) {
- return style.font_size_ratio >= 0.0 && style.font_size_ratio <= 1.0 &&
- style.roundness >= 0.0 && style.roundness <= 1.0;
+ is_default_background_color == other.is_default_background_color;
}
void SetDominantColorAsBackground(

Powered by Google App Engine
This is Rietveld 408576698