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

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
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..857cc147b8609fba59b2114a91bf44ea44bc3faf 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,12 @@ 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|,
huangs 2015/04/17 15:30:47 NIT: The fact that default text is light seems to
beaudoin 2015/04/17 20:29:05 I agree with you, but if the text is dark we shoul
huangs 2015/04/17 20:44:04 Acknowledged.
+// 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
huangs 2015/04/17 15:30:47 NIT: Add space?
beaudoin 2015/04/17 20:29:05 Done.
#endif // COMPONENTS_FAVICON_BASE_FALLBACK_ICON_STYLE_H_

Powered by Google App Engine
This is Rietveld 408576698