Index: chrome/browser/search/suggestions/suggestions_service.cc |
diff --git a/chrome/browser/search/suggestions/suggestions_service.cc b/chrome/browser/search/suggestions/suggestions_service.cc |
index f6c0d5fc1dadc1dfdf0bc96347414c3ef277ef82..66024b6296da44b078ec7f23cecd60484b1c13fb 100644 |
--- a/chrome/browser/search/suggestions/suggestions_service.cc |
+++ b/chrome/browser/search/suggestions/suggestions_service.cc |
@@ -68,7 +68,8 @@ const char kSuggestionsFieldTrialStateParam[] = "state"; |
const char kSuggestionsFieldTrialStateEnabled[] = "enabled"; |
SuggestionsService::SuggestionsService(Profile* profile) |
- : profile_(profile) { |
+ : thumbnail_manager_(new ThumbnailManager(profile)), |
+ profile_(profile) { |
// Obtain the URL to use to fetch suggestions data from the Variations param. |
suggestions_url_ = GURL(GetExperimentParam(kSuggestionsFieldTrialURLParam)); |
} |
@@ -111,6 +112,12 @@ void SuggestionsService::FetchSuggestionsData( |
last_request_started_time_ = base::TimeTicks::Now(); |
} |
+void SuggestionsService::GetPageThumbnail( |
+ const GURL& url, |
+ base::Callback<void(const GURL&, const SkBitmap*)> callback) { |
+ thumbnail_manager_->GetPageThumbnail(url, callback); |
+} |
+ |
void SuggestionsService::OnURLFetchComplete(const net::URLFetcher* source) { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
DCHECK_EQ(pending_request_.get(), source); |
@@ -154,6 +161,7 @@ void SuggestionsService::OnURLFetchComplete(const net::URLFetcher* source) { |
LogResponseState(RESPONSE_EMPTY); |
} else if (suggestions.ParseFromString(suggestions_data)) { |
LogResponseState(RESPONSE_VALID); |
+ thumbnail_manager_->InitializeThumbnailMap(suggestions); |
} else { |
LogResponseState(RESPONSE_INVALID); |
} |