summaryrefslogtreecommitdiffstats
path: root/components/favicon_base/fallback_icon_style.h
diff options
context:
space:
mode:
authorbeaudoin <beaudoin@chromium.org>2015-04-22 10:12:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-22 17:13:08 +0000
commit3e75e59228ae3c4388379ed90ebea2e30ca0c646 (patch)
tree53afc9924fb90f3521f711b59262e692263d1d9c /components/favicon_base/fallback_icon_style.h
parent5d19e06a5124f148e79838966cf9c9bfe68d3de6 (diff)
downloadchromium_src-3e75e59228ae3c4388379ed90ebea2e30ca0c646.zip
chromium_src-3e75e59228ae3c4388379ed90ebea2e30ca0c646.tar.gz
chromium_src-3e75e59228ae3c4388379ed90ebea2e30ca0c646.tar.bz2
[Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to a new large_icon_service.
This is required since the Android implementation of the icon-based NTP will rely on custom Java code to render the fallback. As a result we want to share the logic needed to retrieve large icons and to compute the fallback style without needing them to go through the full-featured chrome://large-icon that performs the rendering of fallback icons. The Java code will hook directly into the large_icon_service. This CL also fixes a bug, making sure only non-square icons can be returned as large icons. Besides this, this CL doesn't change the behavior but will make it possible to add the large icon selection logic to large_icon_service where it can be shared with the Android code. BUG=467712 Review URL: https://codereview.chromium.org/1092873002 Cr-Commit-Position: refs/heads/master@{#326325}
Diffstat (limited to 'components/favicon_base/fallback_icon_style.h')
-rw-r--r--components/favicon_base/fallback_icon_style.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/favicon_base/fallback_icon_style.h b/components/favicon_base/fallback_icon_style.h
index 097636b..84842ed 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_