| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 std::unique_ptr<IdentityProvider> identity_provider( | 67 std::unique_ptr<IdentityProvider> identity_provider( |
| 68 new ProfileIdentityProvider( | 68 new ProfileIdentityProvider( |
| 69 ios::SigninManagerFactory::GetForBrowserState(browser_state), | 69 ios::SigninManagerFactory::GetForBrowserState(browser_state), |
| 70 OAuth2TokenServiceFactory::GetForBrowserState(browser_state), | 70 OAuth2TokenServiceFactory::GetForBrowserState(browser_state), |
| 71 // LoginUIServiceFactory is not built on iOS. | 71 // LoginUIServiceFactory is not built on iOS. |
| 72 base::Closure())); | 72 base::Closure())); |
| 73 | 73 |
| 74 std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService( | 74 std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService( |
| 75 web::GetWebClient()->GetUserAgent(false), std::move(identity_provider), | 75 web::GetWebClient()->GetUserAgent(false), std::move(identity_provider), |
| 76 base::WrapUnique(new invalidation::TiclProfileSettingsProvider( | 76 base::MakeUnique<invalidation::TiclProfileSettingsProvider>( |
| 77 browser_state->GetPrefs())), | 77 browser_state->GetPrefs()), |
| 78 IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) | 78 IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) |
| 79 ->driver(), | 79 ->driver(), |
| 80 browser_state->GetRequestContext())); | 80 browser_state->GetRequestContext())); |
| 81 service->Init( | 81 service->Init( |
| 82 base::WrapUnique(new InvalidatorStorage(browser_state->GetPrefs()))); | 82 base::MakeUnique<InvalidatorStorage>(browser_state->GetPrefs())); |
| 83 | 83 |
| 84 return base::WrapUnique(new ProfileInvalidationProvider(std::move(service))); | 84 return base::MakeUnique<ProfileInvalidationProvider>(std::move(service)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs( | 87 void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs( |
| 88 user_prefs::PrefRegistrySyncable* registry) { | 88 user_prefs::PrefRegistrySyncable* registry) { |
| 89 ProfileInvalidationProvider::RegisterProfilePrefs(registry); | 89 ProfileInvalidationProvider::RegisterProfilePrefs(registry); |
| 90 InvalidatorStorage::RegisterProfilePrefs(registry); | 90 InvalidatorStorage::RegisterProfilePrefs(registry); |
| 91 } | 91 } |
| OLD | NEW |