Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(956)

Unified Diff: components/enhanced_bookmarks/bookmark_image_service.h

Issue 899653003: [Enhanced Bookmark]Upstream image fetching code in android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/enhanced_bookmarks/bookmark_image_service.h
diff --git a/components/enhanced_bookmarks/bookmark_image_service.h b/components/enhanced_bookmarks/bookmark_image_service.h
index 5bf2637ca9e039da6c64a8ab58d06e408c887012..fcd60f9dc3a4d3be94816d9026a5d1a6b7e1be07 100644
--- a/components/enhanced_bookmarks/bookmark_image_service.h
+++ b/components/enhanced_bookmarks/bookmark_image_service.h
@@ -80,8 +80,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. If update_bookmarks is true, relates the
lpromero 2015/02/04 13:54:51 s/local/local storage.
Ian Wen 2015/02/05 18:33:17 Done.
+ // corresponding bookmark to image_url.
void ProcessNewImage(const GURL& page_url,
bool update_bookmarks,
const gfx::Image& image,
@@ -109,11 +109,14 @@ 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.
- void SalientImageForUrl(const GURL& page_url,
- bool fetch_from_bookmark,
- ImageCallback stack_callback);
+ // Retrieve the salient image associated with page_url from local storage.
lpromero 2015/02/04 13:54:51 s/Retrieve/Retrieves
Ian Wen 2015/02/05 18:33:17 Done.
+ void SalientImageFromLocal(const GURL& page_url, ImageCallback callback);
+
+ // If the salient image of the page_url has already been stored locally, this
+ // method is identical to SalientImageFromLocal. Otherwise, it first downloads
+ // the image (if any), stores it to local storage, then call
+ // SalientImageFromLocal.
+ void SalientImageFromWeb(const GURL& page_url, ImageCallback callback);
// Processes the requests that have been waiting on an image.
void ProcessRequests(const GURL& page_url, const ImageRecord& image);

Powered by Google App Engine
This is Rietveld 408576698