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

Unified Diff: chrome/browser/ui/views/ash/app_list/search_builder.cc

Issue 10542076: ABANDONED: chromeos: Download contacts (work in progress). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 8 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/ash/app_list/search_builder.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/app_list/search_builder.cc
diff --git a/chrome/browser/ui/views/ash/app_list/search_builder.cc b/chrome/browser/ui/views/ash/app_list/search_builder.cc
index ce0374f90e8e9455a671e50c8662c51400e6e041..1eea3d864f8664d7afb56149e8047a21c134d29c 100644
--- a/chrome/browser/ui/views/ash/app_list/search_builder.cc
+++ b/chrome/browser/ui/views/ash/app_list/search_builder.cc
@@ -88,6 +88,13 @@ const extensions::Extension* GetExtensionByURL(Profile* profile,
service->GetInstalledApp(url);
}
+#if defined(OS_CHROMEOS)
+const contacts::Contact* GetContactByURL(const GURL& url) {
+ return contacts::ContactManager::GetInstance()->GetContactByProviderId(
+ url.spec());
+}
+#endif
+
// SearchBuildResult is an app list SearchResult built from an
// AutocompleteMatch.
class SearchBuilderResult : public app_list::SearchResult,
@@ -116,6 +123,17 @@ class SearchBuilderResult : public app_list::SearchResult,
}
}
+#if defined(OS_CHROMEOS)
+ if (match_.type == AutocompleteMatch::CONTACT) {
+ const contacts::Contact* contact =
+ GetContactByURL(match_.destination_url);
+ if (contact && !contact->photo.empty() && !contact->photo.isNull()) {
+ SetIcon(contact->photo);
+ return;
+ }
+ }
+#endif
+
int resource_id = match_.starred ?
IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type);
SetIcon(*ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(
« no previous file with comments | « chrome/browser/ui/views/ash/app_list/search_builder.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698