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

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

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: rebase Created 7 years, 11 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.h
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.h b/chrome/browser/extensions/api/omnibox/omnibox_api.h
index db0ba837c72e8f127b62088f4291b6014c0ace1d..ea4cde62bd7f00b23c7d3bef5e89cd4fe061a3fc 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.h
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.h
@@ -12,9 +12,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/extensions/extension_icon_manager.h"
-#include "chrome/browser/profiles/profile_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -78,14 +78,14 @@ class OmniboxSendSuggestionsFunction : public SyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
};
-class OmniboxAPI : public ProfileKeyedService,
+class OmniboxAPI : public ProfileKeyedAPI,
public content::NotificationObserver {
public:
explicit OmniboxAPI(Profile* profile);
virtual ~OmniboxAPI();
- // ProfileKeyedService implementation.
- virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<OmniboxAPI>* GetFactoryInstance();
// Convenience method to get the OmniboxAPI for a profile.
static OmniboxAPI* Get(Profile* profile);
@@ -103,8 +103,16 @@ class OmniboxAPI : public ProfileKeyedService,
gfx::Image GetOmniboxPopupIcon(const std::string& extension_id);
private:
+ friend class ProfileKeyedAPIFactory<OmniboxAPI>;
+
typedef std::set<const Extension*> PendingExtensions;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "OmniboxAPI";
+ }
+ static const bool kServiceRedirectedInIncognito = true;
+
TemplateURLService* url_service_;
// List of extensions waiting for the TemplateURLService to Load to
@@ -116,6 +124,8 @@ class OmniboxAPI : public ProfileKeyedService,
// Keeps track of favicon-sized omnibox icons for extensions.
ExtensionIconManager omnibox_icon_manager_;
ExtensionIconManager omnibox_popup_icon_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(OmniboxAPI);
};
class OmniboxSetDefaultSuggestionFunction : public SyncExtensionFunction {

Powered by Google App Engine
This is Rietveld 408576698