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

Unified Diff: chrome/browser/extensions/api/developer_private/developer_private_api.h

Issue 168253002: Cleanup many APIs to use ProfileKeyedAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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/developer_private/developer_private_api.h
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h
index a29f33a11ef057283c51ba2b8d235bf436bf1caf..eb31f192257a842ce4b3d70c7e7f49a285e216f5 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.h
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h
@@ -10,13 +10,13 @@
#include "base/files/file.h"
#include "chrome/browser/extensions/api/developer_private/entry_picker.h"
#include "chrome/browser/extensions/api/file_system/file_system_api.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/extensions/error_console/error_console.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/extensions/pack_extension_job.h"
#include "chrome/browser/extensions/requirements_checker.h"
-#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/render_view_host.h"
@@ -26,6 +26,7 @@
#include "webkit/browser/fileapi/file_system_operation.h"
class ExtensionService;
+class Profile;
namespace extensions {
@@ -90,13 +91,15 @@ class DeveloperPrivateEventRouter : public content::NotificationObserver,
};
// The profile-keyed service that manages the DeveloperPrivate API.
-class DeveloperPrivateAPI : public BrowserContextKeyedService,
+class DeveloperPrivateAPI : public ProfileKeyedAPI,
public EventRouter::Observer {
public:
+ static ProfileKeyedAPIFactory<DeveloperPrivateAPI>* GetFactoryInstance();
+
// Convenience method to get the DeveloperPrivateAPI for a profile.
- static DeveloperPrivateAPI* Get(Profile* profile);
+ static DeveloperPrivateAPI* Get(content::BrowserContext* context);
- explicit DeveloperPrivateAPI(Profile* profile);
+ explicit DeveloperPrivateAPI(content::BrowserContext* context);
virtual ~DeveloperPrivateAPI();
void SetLastUnpackedDirectory(const base::FilePath& path);
@@ -113,6 +116,13 @@ class DeveloperPrivateAPI : public BrowserContextKeyedService,
virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<DeveloperPrivateAPI>;
+
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() { return "DeveloperPrivateAPI"; }
+ static const bool kServiceRedirectedInIncognito = true;
+ static const bool kServiceIsNULLWhileTesting = true;
+
void RegisterNotifications();
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698