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

Unified Diff: chrome/browser/extensions/api/managed_mode/managed_mode_api.h

Issue 11719004: Remove Profile-keyed factory boilerplate: cookies, managed_mode & web_navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years 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/managed_mode/managed_mode_api.h
diff --git a/chrome/browser/extensions/api/managed_mode/managed_mode_api.h b/chrome/browser/extensions/api/managed_mode/managed_mode_api.h
index dbad7a738b388d84247e4fd70addd2901097c226..af635ab2442a6cdf05da7980597ea20564bac34e 100644
--- a/chrome/browser/extensions/api/managed_mode/managed_mode_api.h
+++ b/chrome/browser/extensions/api/managed_mode/managed_mode_api.h
@@ -9,9 +9,9 @@
#define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
#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 Profile;
@@ -81,8 +81,8 @@ class SetPolicyFunction : public SyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
};
-class ManagedModeAPI : public ProfileKeyedService,
- public extensions::EventRouter::Observer {
+class ManagedModeAPI : public ProfileKeyedAPI,
+ public extensions::EventRouter::Observer {
public:
explicit ManagedModeAPI(Profile* profile);
virtual ~ManagedModeAPI();
@@ -95,12 +95,26 @@ class ManagedModeAPI : public ProfileKeyedService,
OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<ManagedModeAPI>;
+
Profile* profile_;
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "ManagedModeAPI";
+ }
+ static const bool kServiceIsNULLWhileTesting = true;
+
// Created lazily upon OnListenerAdded.
scoped_ptr<ManagedModeEventRouter> managed_mode_event_router_;
+
+ DISALLOW_COPY_AND_ASSIGN(ManagedModeAPI);
};
+template <>
+ProfileKeyedAPIFactory<ManagedModeAPI>*
+ProfileKeyedAPIFactory<ManagedModeAPI>::GetInstance();
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_

Powered by Google App Engine
This is Rietveld 408576698