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

Unified Diff: components/favicon_base/fallback_icon_style.h

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/core/large_icon_service.cc ('k') | components/favicon_base/fallback_icon_style.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.h
diff --git a/components/favicon_base/fallback_icon_style.h b/components/favicon_base/fallback_icon_style.h
index 097636b0ccb522aacb2af8aaa0612dfe70afe53d..84842edd7e1765bf52bde9dbc229aed9b6358831 100644
--- a/components/favicon_base/fallback_icon_style.h
+++ b/components/favicon_base/fallback_icon_style.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
#define COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
+#include "base/memory/ref_counted_memory.h"
#include "third_party/skia/include/core/SkColor.h"
namespace favicon_base {
@@ -37,6 +38,13 @@ void MatchFallbackIconTextColorAgainstBackgroundColor(FallbackIconStyle* style);
// Returns whether |style| values are within bounds.
bool ValidateFallbackIconStyle(const FallbackIconStyle& style);
+// Set |style|'s background color to the dominant color of |bitmap_data|,
+// clamping luminance down to a reasonable maximum value so that light text is
+// readable.
+void SetDominantColorAsBackground(
+ const scoped_refptr<base::RefCountedMemory>& bitmap_data,
+ FallbackIconStyle* style);
+
} // namespace favicon_base
#endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_
« no previous file with comments | « components/favicon/core/large_icon_service.cc ('k') | components/favicon_base/fallback_icon_style.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698