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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 2973006: Use the extension icon for extension omnibox results instead of the generic (Closed)
Patch Set: fixed mac Created 10 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/extensions/extensions_service.h ('k') | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 9a9153330a5c2b6b5238d03e4c5d91cd27b8f1f0..3259c113e2fa701c980d73aa7ed6906f9932355e 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -186,6 +186,9 @@ ExtensionsService::ExtensionsService(Profile* profile,
}
backend_ = new ExtensionsServiceBackend(install_directory_);
+
+ // Use monochrome icons for omnibox icons.
+ omnibox_icon_manager_.set_monochrome(true);
}
ExtensionsService::~ExtensionsService() {
@@ -906,6 +909,11 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
if (profile_->GetTemplateURLModel())
profile_->GetTemplateURLModel()->RegisterExtensionKeyword(extension);
+
+ // Load the icon for omnibox-enabled extensions so it will be ready to display
+ // in the URL bar.
+ if (!extension->omnibox_keyword().empty())
+ omnibox_icon_manager_.LoadIcon(extension);
}
void ExtensionsService::UpdateActiveExtensionsInCrashReporter() {
@@ -1029,6 +1037,11 @@ Extension* ExtensionsService::GetExtensionByOverlappingWebExtent(
return NULL;
}
+const SkBitmap& ExtensionsService::GetOmniboxIcon(
+ const std::string& extension_id) {
+ return omnibox_icon_manager_.GetIcon(extension_id);
+}
+
void ExtensionsService::ClearProvidersForTesting() {
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698