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

Unified Diff: chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc

Issue 795863002: [AppList] Use local favicons/icons with URLSuggestionResult (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 6 years 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/ui/app_list/search/suggestions/suggestions_search_provider.cc
diff --git a/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc
index 42af87a1c5d471c7820d5ad91129280dab6e38b0..0e672c3514f5db2fcc44fca88c8aa75d408aea80 100644
--- a/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc
+++ b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc
@@ -6,11 +6,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
+#include "chrome/browser/favicon/chrome_favicon_client_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/suggestions/suggestions_service_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/app_list/search/suggestions/url_suggestion_result.h"
+#include "components/favicon/core/browser/favicon_client.h"
#include "components/suggestions/proto/suggestions.pb.h"
#include "components/suggestions/suggestions_service.h"
#include "components/suggestions/suggestions_utils.h"
@@ -42,6 +44,10 @@ SuggestionsSearchProvider::SuggestionsSearchProvider(
suggestions_service_(
suggestions::SuggestionsServiceFactory::GetForProfile(profile)),
weak_ptr_factory_(this) {
+ FaviconClient* favicon_client =
+ ChromeFaviconClientFactory::GetForProfile(profile);
+ if (favicon_client)
+ favicon_service_ = favicon_client->GetFaviconService();
}
SuggestionsSearchProvider::~SuggestionsSearchProvider() {
@@ -75,7 +81,8 @@ void SuggestionsSearchProvider::OnSuggestionsProfileAvailable(
// TODO(mathp): If it's an app, create an AppResult.
scoped_ptr<URLSuggestionResult> result(new URLSuggestionResult(
- profile_, list_controller_, suggestions_service_, suggestion));
+ profile_, list_controller_, favicon_service_, suggestions_service_,
+ suggestion));
result->set_relevance(1.0 / (i + 1));
Add(result.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698