diff options
author | ianwen <ianwen@chromium.org> | 2015-02-05 12:56:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-05 20:57:16 +0000 |
commit | 566c432e789653356da210e066b1f0ed62f1aa3d (patch) | |
tree | d9548e2392bd7a8de4c26e4474895e99af9854dd /components/enhanced_bookmarks | |
parent | f8b95b1bac2582a87f9f67fb3a35413202ecb07f (diff) | |
download | chromium_src-566c432e789653356da210e066b1f0ed62f1aa3d.zip chromium_src-566c432e789653356da210e066b1f0ed62f1aa3d.tar.gz chromium_src-566c432e789653356da210e066b1f0ed62f1aa3d.tar.bz2 |
[Enhanced Bookmark]Upstream image fetching code in android
This CL added the image fetching code that previously lived in clank private repository.
Also I moved android enhanced_bookmark_bridge from
chrome/browser/android/enhanced_bookmarks/ to chrome/browser/enhanced_bookmarks/android,
since the latter is a more unified place to put all files in.(I deleted the
android/enhanced_bookmarks folder).
Last but not least, I made some small changes to the internal implementation of
bookmark_image_service, making it more readable.
The previously private code can be found in code search:
https://cs.corp.google.com/#clankium/src/clank/native/framework/chrome/enhanced_bookmarks/
Downstream CL: https://chrome-internal-review.googlesource.com/#/c/195438/
BUG=454623
Review URL: https://codereview.chromium.org/899653003
Cr-Commit-Position: refs/heads/master@{#314872}
Diffstat (limited to 'components/enhanced_bookmarks')
-rw-r--r-- | components/enhanced_bookmarks/bookmark_image_service.cc | 4 | ||||
-rw-r--r-- | components/enhanced_bookmarks/bookmark_image_service.h | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/components/enhanced_bookmarks/bookmark_image_service.cc b/components/enhanced_bookmarks/bookmark_image_service.cc index 8fa295e..683ae6e 100644 --- a/components/enhanced_bookmarks/bookmark_image_service.cc +++ b/components/enhanced_bookmarks/bookmark_image_service.cc @@ -166,7 +166,7 @@ void BookmarkImageService::FetchCallback(const GURL& page_url, } void BookmarkImageService::SalientImageForUrl(const GURL& page_url, - bool fetch_from_bookmark, + bool fetch_from_web, ImageCallback callback) { DCHECK(CalledOnValidThread()); @@ -177,7 +177,7 @@ void BookmarkImageService::SalientImageForUrl(const GURL& page_url, return; } - if (!fetch_from_bookmark) { + if (!fetch_from_web) { RetrieveImageFromStore(page_url, callback); } else { RetrieveImageFromStore(page_url, diff --git a/components/enhanced_bookmarks/bookmark_image_service.h b/components/enhanced_bookmarks/bookmark_image_service.h index 53bd47c..8ec1fa8 100644 --- a/components/enhanced_bookmarks/bookmark_image_service.h +++ b/components/enhanced_bookmarks/bookmark_image_service.h @@ -84,8 +84,8 @@ class BookmarkImageService : public KeyedService, // Returns true if the image for the page_url is currently being fetched. bool IsPageUrlInProgress(const GURL& page_url); - // Once an image has been retrieved, store the image and notify all the - // consumers that were waiting on it. + // Stores the image to local storage. If update_bookmarks is true, relates the + // corresponding bookmark to image_url. void ProcessNewImage(const GURL& page_url, bool update_bookmarks, const gfx::Image& image, @@ -113,10 +113,10 @@ class BookmarkImageService : public KeyedService, EnhancedBookmarkModel* enhanced_bookmark_model_; private: - // Same as SalientImageForUrl(const GURL&, ImageCallback) but can - // prevent the network request if fetch_from_bookmark is false. + // If fetch_from_web is true, retrieves the salient image via a network + // request; else only gets the image from local storage. void SalientImageForUrl(const GURL& page_url, - bool fetch_from_bookmark, + bool fetch_from_web, ImageCallback stack_callback); // Processes the requests that have been waiting on an image. |