Index: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h |
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h |
index c4c95483c6a5c62a673c712dbd773634f8701403..89b652d7fd3fb781e4a74cacdd87807f7e0f0661 100644 |
--- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h |
+++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h |
@@ -8,10 +8,10 @@ |
#include <string> |
#include "base/memory/scoped_ptr.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/media_gallery/media_galleries_preferences.h" |
-#include "chrome/browser/profiles/profile_keyed_service.h" |
class FilePath; |
class Profile; |
@@ -23,7 +23,7 @@ class MediaGalleriesPrivateEventRouter; |
// The profile-keyed service that manages the media galleries private extension |
// API. |
-class MediaGalleriesPrivateAPI : public ProfileKeyedService, |
+class MediaGalleriesPrivateAPI : public ProfileKeyedAPI, |
public EventRouter::Observer { |
public: |
explicit MediaGalleriesPrivateAPI(Profile* profile); |
@@ -32,14 +32,28 @@ class MediaGalleriesPrivateAPI : public ProfileKeyedService, |
// ProfileKeyedService implementation. |
virtual void Shutdown() OVERRIDE; |
+ // ProfileKeyedAPI implementation. |
+ static ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>* GetFactoryInstance(); |
+ |
+ // Convenience method to get the MediaGalleriesPrivateAPI for a profile. |
+ static MediaGalleriesPrivateAPI* Get(Profile* profile); |
+ |
// EventRouter::Observer implementation. |
virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
MediaGalleriesPrivateEventRouter* GetEventRouter(); |
private: |
+ friend class ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>; |
+ |
void MaybeInitializeEventRouter(); |
+ // ProfileKeyedAPI implementation. |
+ static const char* service_name() { |
+ return "MediaGalleriesPrivateAPI"; |
+ } |
+ static const bool kServiceIsNULLWhileTesting = true; |
+ |
// Current profile. |
Profile* profile_; |