Index: components/enhanced_bookmarks/image_store_util.cc |
diff --git a/components/enhanced_bookmarks/image_store_util.cc b/components/enhanced_bookmarks/image_store_util.cc |
index 213b5950fe516290d094cc7b0a8f53b793027cf2..ef3979d90902c104cfe03b47aecfde7d71201372 100644 |
--- a/components/enhanced_bookmarks/image_store_util.cc |
+++ b/components/enhanced_bookmarks/image_store_util.cc |
@@ -4,6 +4,8 @@ |
#include "components/enhanced_bookmarks/image_store_util.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
+#include "ui/gfx/color_analysis.h" |
#include "ui/gfx/image/image_skia.h" |
#include "ui/gfx/image/image_util.h" |
@@ -30,4 +32,8 @@ scoped_refptr<base::RefCountedMemory> BytesForImage(const gfx::Image& image) { |
gfx::Image ImageForBytes(const scoped_refptr<base::RefCountedMemory>& bytes) { |
return gfx::ImageFrom1xJPEGEncodedData(bytes->front(), bytes->size()); |
} |
+ |
+SkColor DominantColorForImage(const gfx::Image& image) { |
+ return color_utils::CalculateKMeanColorOfBitmap(*image.ToSkBitmap()); |
+} |
} |