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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_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/bluetooth/bluetooth_api.h
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
index d914b42df10e415d5972fb59740931583345d671..e7b37aec5701108a5f3001daab25a4bf5e9af0e7 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/api/api_function.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h"
-#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_profile.h"
#include "extensions/browser/event_router.h"
@@ -30,13 +30,14 @@ namespace extensions {
class ExtensionBluetoothEventRouter;
// The profile-keyed service that manages the bluetooth extension API.
-class BluetoothAPI : public BrowserContextKeyedService,
- public EventRouter::Observer {
+class BluetoothAPI : public ProfileKeyedAPI, public EventRouter::Observer {
public:
// Convenience method to get the BluetoothAPI for a profile.
- static BluetoothAPI* Get(Profile* profile);
+ static BluetoothAPI* Get(content::BrowserContext* context);
- explicit BluetoothAPI(Profile* profile);
+ static ProfileKeyedAPIFactory<BluetoothAPI>* GetFactoryInstance();
+
+ explicit BluetoothAPI(content::BrowserContext* context);
virtual ~BluetoothAPI();
ExtensionBluetoothEventRouter* bluetooth_event_router();
@@ -49,6 +50,13 @@ class BluetoothAPI : public BrowserContextKeyedService,
virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE;
private:
+ friend class ProfileKeyedAPIFactory<BluetoothAPI>;
+
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() { return "BluetoothAPI"; }
+ static const bool kServiceRedirectedInIncognito = true;
+ static const bool kServiceIsNULLWhileTesting = true;
+
Profile* profile_;
// Created lazily on first access.

Powered by Google App Engine
This is Rietveld 408576698