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

Unified Diff: chrome/browser/extensions/api/preference/preference_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: 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/preference/preference_api.h
diff --git a/chrome/browser/extensions/api/preference/preference_api.h b/chrome/browser/extensions/api/preference/preference_api.h
index f7a799aec8cdfa5b432ce294c60cc94813843ebb..872567bd3ab8b7cdfe9e47ae445a853330522191 100644
--- a/chrome/browser/extensions/api/preference/preference_api.h
+++ b/chrome/browser/extensions/api/preference/preference_api.h
@@ -8,9 +8,9 @@
#include <string>
#include "base/prefs/public/pref_change_registrar.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/browser/profiles/profile_keyed_service.h"
#include "content/public/browser/notification_observer.h"
class PrefService;
@@ -39,7 +39,7 @@ class PreferenceEventRouter {
DISALLOW_COPY_AND_ASSIGN(PreferenceEventRouter);
};
-class PreferenceAPI : public ProfileKeyedService,
+class PreferenceAPI : public ProfileKeyedAPI,
public EventRouter::Observer {
public:
explicit PreferenceAPI(Profile* profile);
@@ -52,12 +52,26 @@ class PreferenceAPI : public ProfileKeyedService,
virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<PreferenceAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "PreferenceAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created lazily upon OnListenerAdded.
scoped_ptr<PreferenceEventRouter> preference_event_router_;
+
+ DISALLOW_COPY_AND_ASSIGN(PreferenceAPI);
};
+template <>
+ProfileKeyedAPIFactory<PreferenceAPI>*
+ProfileKeyedAPIFactory<PreferenceAPI>::GetInstance();
+
class PrefTransformerInterface {
public:
virtual ~PrefTransformerInterface() {}

Powered by Google App Engine
This is Rietveld 408576698