summaryrefslogtreecommitdiffstats
path: root/components/enhanced_bookmarks/test_image_store.h
diff options
context:
space:
mode:
authorlpromero <lpromero@chromium.org>2015-01-23 12:17:36 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 20:18:40 +0000
commita110f52e83cebd2b6f0ed37c34abeac8bfcb1b72 (patch)
treeb0054fe1a2bbb25a9532fb7a1b9a1decb5b62a6d /components/enhanced_bookmarks/test_image_store.h
parent921392d21263c05b374d94ae3da3120094cd6a65 (diff)
downloadchromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.zip
chromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.tar.gz
chromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.tar.bz2
★ Record the image dominant color in the image database.
This CL adds a column in the bookmarks images database. It contains the dominant color extracted from the image. Since this computation can be lengthy, it is done in the background, when the image is stored in the database. For old databases, a migration path is provided and the dominant color is computed and stored upon querying the image for the first time. BUG=448443 Review URL: https://codereview.chromium.org/875463003 Cr-Commit-Position: refs/heads/master@{#312916}
Diffstat (limited to 'components/enhanced_bookmarks/test_image_store.h')
-rw-r--r--components/enhanced_bookmarks/test_image_store.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/components/enhanced_bookmarks/test_image_store.h b/components/enhanced_bookmarks/test_image_store.h
index 5acef16..460a285 100644
--- a/components/enhanced_bookmarks/test_image_store.h
+++ b/components/enhanced_bookmarks/test_image_store.h
@@ -15,10 +15,9 @@ class TestImageStore : public ImageStore {
TestImageStore();
bool HasKey(const GURL& page_url) override;
void Insert(const GURL& page_url,
- const GURL& image_url,
- const gfx::Image& image) override;
+ const enhanced_bookmarks::ImageRecord& image) override;
void Erase(const GURL& page_url) override;
- std::pair<gfx::Image, GURL> Get(const GURL& page_url) override;
+ enhanced_bookmarks::ImageRecord Get(const GURL& page_url) override;
gfx::Size GetSize(const GURL& page_url) override;
void GetAllPageUrls(std::set<GURL>* urls) override;
void ClearAll() override;
@@ -28,7 +27,7 @@ class TestImageStore : public ImageStore {
~TestImageStore() override;
private:
- typedef std::map<const GURL, std::pair<gfx::Image, const GURL> > ImageMap;
+ typedef std::map<const GURL, enhanced_bookmarks::ImageRecord> ImageMap;
ImageMap store_;
DISALLOW_COPY_AND_ASSIGN(TestImageStore);