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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 11682005: Remove some Profile-keyed factory boilerplate: management omnibox preference push_messaging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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/extensions/api/omnibox/omnibox_api.cc
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index 37f125103e6ec613a70be2af3ed6a652c34cc830..f36d29c42a21aac4917ec2ba2fdb0b48f27c26af 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -10,7 +10,6 @@
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/extensions/api/omnibox/omnibox_api_factory.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -157,7 +156,7 @@ void OmniboxAPI::Shutdown() {
// static
OmniboxAPI* OmniboxAPI::Get(Profile* profile) {
- return OmniboxAPIFactory::GetForProfile(profile);
+ return ProfileKeyedAPIFactory<OmniboxAPI>::GetForProfile(profile);
}
void OmniboxAPI::Observe(int type,
@@ -215,6 +214,15 @@ gfx::Image OmniboxAPI::GetOmniboxPopupIcon(const std::string& extension_id) {
return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id));
}
+base::LazyInstance<ProfileKeyedAPIFactory<OmniboxAPI> >
+g_factory = LAZY_INSTANCE_INITIALIZER;
+
+template <>
+ProfileKeyedAPIFactory<OmniboxAPI>*
+ProfileKeyedAPIFactory<OmniboxAPI>::GetInstance() {
+ return &g_factory.Get();
+}
+
bool OmniboxSendSuggestionsFunction::RunImpl() {
ExtensionOmniboxSuggestions suggestions;
ListValue* suggestions_value;

Powered by Google App Engine
This is Rietveld 408576698