Index: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api_factory.cc |
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api_factory.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api_factory.cc |
index 4d4effc61c6fc7b55b88e70e0a62400a318450a5..065a3b4487f768c8b4c44f9319c2ce77c7918274 100644 |
--- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api_factory.cc |
+++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api_factory.cc |
@@ -6,14 +6,29 @@ |
#include "chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h" |
#include "chrome/browser/extensions/extension_system_factory.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_dependency_manager.h" |
namespace extensions { |
+namespace { |
+ |
+base::LazyInstance<MediaGalleriesPrivateAPIFactory> |
+ g_media_galleries_private_api_factory = LAZY_INSTANCE_INITIALIZER; |
+ |
+} // namespace |
+ |
// static |
MediaGalleriesPrivateAPIFactory* |
MediaGalleriesPrivateAPIFactory::GetInstance() { |
- return Singleton<MediaGalleriesPrivateAPIFactory>::get(); |
+ return g_media_galleries_private_api_factory.Pointer(); |
+} |
+ |
+// static |
+MediaGalleriesPrivateAPI* MediaGalleriesPrivateAPIFactory::GetForProfile( |
+ Profile* profile) { |
+ return static_cast<MediaGalleriesPrivateAPI*>( |
+ GetInstance()->GetServiceForProfile(profile, true)); |
} |
MediaGalleriesPrivateAPIFactory::MediaGalleriesPrivateAPIFactory() |