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

Unified Diff: components/favicon_base/fallback_icon_style.cc

Issue 2883053003: Delete unused chrome://fallback-icon/ handling (Closed)
Patch Set: Merge branch 'master' 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
« no previous file with comments | « components/favicon_base/fallback_icon_style.h ('k') | components/favicon_base/fallback_icon_url_parser.h » ('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 cbb478b1a175ed7993e735a2b4a16255e1c454b7..c85d768e68f4328d8acb94952dcd91afe5be9f74 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,20 +20,14 @@ 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).
+const SkColor kDefaultTextColor = SK_ColorWHITE;
} // namespace
FallbackIconStyle::FallbackIconStyle()
: background_color(kDefaultBackgroundColor),
is_default_background_color(true),
- text_color(kDefaultTextColorLight),
- font_size_ratio(kDefaultFontSizeRatio),
- roundness(kDefaultRoundness) {}
+ text_color(kDefaultTextColor) {}
FallbackIconStyle::~FallbackIconStyle() {
}
@@ -45,21 +35,7 @@ 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;
+ text_color == other.text_color;
}
void SetDominantColorAsBackground(
« no previous file with comments | « components/favicon_base/fallback_icon_style.h ('k') | components/favicon_base/fallback_icon_url_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698