Index: chrome/browser/push_messaging/push_messaging_service_factory.cc |
diff --git a/chrome/browser/push_messaging/push_messaging_service_factory.cc b/chrome/browser/push_messaging/push_messaging_service_factory.cc |
index c400f7980591700a02308bd91493e465f0c8cd79..85b946c3e1f898b0c069e31ec8160a6add700c75 100644 |
--- a/chrome/browser/push_messaging/push_messaging_service_factory.cc |
+++ b/chrome/browser/push_messaging/push_messaging_service_factory.cc |
@@ -10,20 +10,25 @@ |
#include "chrome/browser/profiles/incognito_helpers.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
-#include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
-#include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
+#include "chrome/browser/services/gcm/instance_id/instance_id_profile_service.h" |
+#include "chrome/browser/services/gcm/instance_id/instance_id_profile_service_factory.h" |
#include "components/keyed_service/content/browser_context_dependency_manager.h" |
// static |
PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile( |
- content::BrowserContext* profile) { |
+ content::BrowserContext* context) { |
// The Push API is not currently supported in incognito mode. |
// See https://crbug.com/401439. |
- if (profile->IsOffTheRecord()) |
- return NULL; |
+ if (context->IsOffTheRecord()) |
+ return nullptr; |
+ |
+ if (!instance_id::InstanceIDProfileService::IsInstanceIDEnabled( |
+ Profile::FromBrowserContext(context))) { |
+ return nullptr; |
Peter Beverloo
2016/04/11 15:47:56
+LOG(WARNING)?
johnme
2016/04/21 10:58:37
Added a DLOG(WARNING).
|
+ } |
return static_cast<PushMessagingServiceImpl*>( |
- GetInstance()->GetServiceForBrowserContext(profile, true)); |
+ GetInstance()->GetServiceForBrowserContext(context, true)); |
} |
// static |
@@ -35,7 +40,7 @@ PushMessagingServiceFactory::PushMessagingServiceFactory() |
: BrowserContextKeyedServiceFactory( |
"PushMessagingProfileService", |
BrowserContextDependencyManager::GetInstance()) { |
- DependsOn(gcm::GCMProfileServiceFactory::GetInstance()); |
Peter Beverloo
2016/04/11 15:47:56
We still use the GCMProfileServiceFactory in the S
johnme
2016/04/21 10:58:37
Good point. Readded (I guess it was working only b
|
+ DependsOn(instance_id::InstanceIDProfileServiceFactory::GetInstance()); |
DependsOn(HostContentSettingsMapFactory::GetInstance()); |
DependsOn(PermissionManagerFactory::GetInstance()); |
} |