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

Unified Diff: chrome/browser/search/suggestions/suggestions_service.h

Issue 299713007: [Suggestions] Adding a Thumbnail Manager for the Suggestions Service (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean Created 6 years, 7 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: chrome/browser/search/suggestions/suggestions_service.h
diff --git a/chrome/browser/search/suggestions/suggestions_service.h b/chrome/browser/search/suggestions/suggestions_service.h
index 972cfce63ada136e3d84343cdcf43cd140f1c4e4..40e127dffa2510bd67a3f7179faa94aa36ff7767 100644
--- a/chrome/browser/search/suggestions/suggestions_service.h
+++ b/chrome/browser/search/suggestions/suggestions_service.h
@@ -13,6 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "chrome/browser/search/suggestions/proto/suggestions.pb.h"
+#include "chrome/browser/search/suggestions/thumbnail_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
@@ -43,6 +44,13 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate {
// fetch request completes.
void FetchSuggestionsData(ResponseCallback callback);
+ // For a given |url|, if a thumbnail URL is known for it, will start the fetch
+ // of the image and |callback|. In the case of a |url| for which the thumbnail
+ // is not known, the bitmap pointer given to the |callback| will be NULL.
+ void GetURLThumbnail(
huangs 2014/05/22 06:17:35 Suggest that you shorten this to: // Retrieves st
Mathieu 2014/05/22 15:45:51 Done.
+ const GURL& url,
+ ThumbnailManager::BitmapResponseCallback callback);
+
private:
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, FetchSuggestionsData);
@@ -68,6 +76,9 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate {
// Queue of callbacks. These are flushed when fetch request completes.
std::vector<ResponseCallback> waiting_requestors_;
+ // Used to obtain server thumbnails, if available.
+ scoped_ptr<ThumbnailManager> thumbnail_manager_;
+
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(SuggestionsService);

Powered by Google App Engine
This is Rietveld 408576698