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

Unified Diff: ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: Address jianli's review comments Created 4 years, 4 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: ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc
diff --git a/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc b/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc
index abe148c203262355df0d8991b94d1f0454b14f48..35db7f15f76565e9b6cd4b45e050a9782448bdfc 100644
--- a/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc
+++ b/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc
@@ -32,6 +32,18 @@ IOSChromeGCMProfileServiceFactory::GetInstance() {
return base::Singleton<IOSChromeGCMProfileServiceFactory>::get();
}
+// static
+std::string IOSChromeGCMProfileServiceFactory::GetProductCategoryForSubtypes() {
+#if defined(GOOGLE_CHROME_BUILD)
+ std::string channel = ::GetChannelString();
+ if (channel.empty())
+ channel = "stable";
+ return "com.chrome." + channel + ".ios";
+#else
+ return "org.chromium.unknown.ios";
+#endif
droger 2016/08/16 08:05:23 Why is this code different on iOS? Would it make s
johnme 2016/08/18 17:43:22 iOS can't access the cross platform version in chr
droger 2016/08/19 09:10:28 Ok thanks, this seems reasonable indeed. FYI ther
+}
+
IOSChromeGCMProfileServiceFactory::IOSChromeGCMProfileServiceFactory()
: BrowserStateKeyedServiceFactory(
"GCMProfileService",
@@ -57,6 +69,7 @@ IOSChromeGCMProfileServiceFactory::BuildServiceInstanceFor(
return base::WrapUnique(new gcm::GCMProfileService(
browser_state->GetPrefs(), browser_state->GetStatePath(),
browser_state->GetRequestContext(), ::GetChannel(),
+ GetProductCategoryForSubtypes(),
base::WrapUnique(new ProfileIdentityProvider(
ios::SigninManagerFactory::GetForBrowserState(browser_state),
OAuth2TokenServiceFactory::GetForBrowserState(browser_state),

Powered by Google App Engine
This is Rietveld 408576698