Index: components/enhanced_bookmarks/image_store_util_ios.mm |
diff --git a/components/enhanced_bookmarks/image_store_util_ios.mm b/components/enhanced_bookmarks/image_store_util_ios.mm |
index 5d027cbaaaef195aba1b8abe53ee07ef8a81e83b..98a08dbc7f34124de20d5076400ee47c0e7ede11 100644 |
--- a/components/enhanced_bookmarks/image_store_util_ios.mm |
+++ b/components/enhanced_bookmarks/image_store_util_ios.mm |
@@ -8,6 +8,8 @@ |
#include "base/mac/scoped_cftyperef.h" |
#include "base/mac/scoped_nsobject.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
+#include "ui/gfx/color_analysis.h" |
namespace { |
// An implementation of RefCountedMemory, where the bytes are stored in a |
@@ -45,4 +47,8 @@ gfx::Image ImageForBytes(const scoped_refptr<base::RefCountedMemory>& data) { |
[NSData dataWithBytes:data->front() length:data->size()]] retain]); |
} |
+SkColor DominantColorForImage(const gfx::Image& image) { |
+ return color_utils::CalculateKMeanColorOfBitmap(*image.ToSkBitmap()); |
+} |
+ |
} // namespace enhanced_bookmarks |