summaryrefslogtreecommitdiffstats
path: root/components/favicon_base
diff options
context:
space:
mode:
Diffstat (limited to 'components/favicon_base')
-rw-r--r--components/favicon_base/fallback_icon_style.cc7
-rw-r--r--components/favicon_base/fallback_icon_style.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/components/favicon_base/fallback_icon_style.cc b/components/favicon_base/fallback_icon_style.cc
index d3e395b..a3aa658 100644
--- a/components/favicon_base/fallback_icon_style.cc
+++ b/components/favicon_base/fallback_icon_style.cc
@@ -41,6 +41,13 @@ FallbackIconStyle::FallbackIconStyle()
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;
+}
+
void MatchFallbackIconTextColorAgainstBackgroundColor(
FallbackIconStyle* style) {
int luminance = color_utils::GetLuminanceForColor(style->background_color);
diff --git a/components/favicon_base/fallback_icon_style.h b/components/favicon_base/fallback_icon_style.h
index 84842ed..478efb8 100644
--- a/components/favicon_base/fallback_icon_style.h
+++ b/components/favicon_base/fallback_icon_style.h
@@ -30,6 +30,8 @@ struct FallbackIconStyle {
// The roundness of the icon's corners. 0 => square icon, 1 => circle icon.
double roundness;
+
+ bool operator==(const FallbackIconStyle& other) const;
};
// Reassigns |style|'s |text_color| to matches well against |background_color|.