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

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: 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/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..d37a78ac4c894aedf8888d4e6ad3a21f8608808b 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);
@@ -48,14 +48,27 @@ class PreferenceAPI : public ProfileKeyedService,
// ProfileKeyedService implementation.
virtual void Shutdown() OVERRIDE;
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance();
+
// EventRouter::Observer implementation.
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);
};
class PrefTransformerInterface {

Powered by Google App Engine
This is Rietveld 408576698