OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" | 5 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ios::ChromeBrowserState::FromBrowserState(context); | 69 ios::ChromeBrowserState::FromBrowserState(context); |
70 | 70 |
71 std::unique_ptr<IdentityProvider> identity_provider( | 71 std::unique_ptr<IdentityProvider> identity_provider( |
72 new ProfileIdentityProvider( | 72 new ProfileIdentityProvider( |
73 ios::SigninManagerFactory::GetForBrowserState(browser_state), | 73 ios::SigninManagerFactory::GetForBrowserState(browser_state), |
74 OAuth2TokenServiceFactory::GetForBrowserState(browser_state), | 74 OAuth2TokenServiceFactory::GetForBrowserState(browser_state), |
75 // LoginUIServiceFactory is not built on iOS. | 75 // LoginUIServiceFactory is not built on iOS. |
76 base::Closure())); | 76 base::Closure())); |
77 | 77 |
78 std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService( | 78 std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService( |
79 web::GetWebClient()->GetUserAgent(false), std::move(identity_provider), | 79 web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE), |
| 80 std::move(identity_provider), |
80 base::MakeUnique<invalidation::TiclProfileSettingsProvider>( | 81 base::MakeUnique<invalidation::TiclProfileSettingsProvider>( |
81 browser_state->GetPrefs()), | 82 browser_state->GetPrefs()), |
82 IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) | 83 IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) |
83 ->driver(), | 84 ->driver(), |
84 browser_state->GetRequestContext())); | 85 browser_state->GetRequestContext())); |
85 service->Init( | 86 service->Init( |
86 base::MakeUnique<InvalidatorStorage>(browser_state->GetPrefs())); | 87 base::MakeUnique<InvalidatorStorage>(browser_state->GetPrefs())); |
87 | 88 |
88 return base::MakeUnique<ProfileInvalidationProvider>(std::move(service)); | 89 return base::MakeUnique<ProfileInvalidationProvider>(std::move(service)); |
89 } | 90 } |
90 | 91 |
91 void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs( | 92 void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs( |
92 user_prefs::PrefRegistrySyncable* registry) { | 93 user_prefs::PrefRegistrySyncable* registry) { |
93 ProfileInvalidationProvider::RegisterProfilePrefs(registry); | 94 ProfileInvalidationProvider::RegisterProfilePrefs(registry); |
94 InvalidatorStorage::RegisterProfilePrefs(registry); | 95 InvalidatorStorage::RegisterProfilePrefs(registry); |
95 } | 96 } |
OLD | NEW |