| 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/sync/ios_chrome_sync_client.h" | 5 #include "ios/chrome/browser/sync/ios_chrome_sync_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // Component factory may already be set in tests. | 151 // Component factory may already be set in tests. |
| 152 if (!GetSyncApiComponentFactory()) { | 152 if (!GetSyncApiComponentFactory()) { |
| 153 const GURL sync_service_url = GetSyncServiceURL( | 153 const GURL sync_service_url = GetSyncServiceURL( |
| 154 *base::CommandLine::ForCurrentProcess(), ::GetChannel()); | 154 *base::CommandLine::ForCurrentProcess(), ::GetChannel()); |
| 155 ProfileOAuth2TokenService* token_service = | 155 ProfileOAuth2TokenService* token_service = |
| 156 OAuth2TokenServiceFactory::GetForBrowserState(browser_state_); | 156 OAuth2TokenServiceFactory::GetForBrowserState(browser_state_); |
| 157 | 157 |
| 158 net::URLRequestContextGetter* url_request_context_getter = | 158 net::URLRequestContextGetter* url_request_context_getter = |
| 159 browser_state_->GetRequestContext(); | 159 browser_state_->GetRequestContext(); |
| 160 | 160 |
| 161 component_factory_.reset(new ProfileSyncComponentsFactoryImpl( | 161 component_factory_.reset(new browser_sync::ProfileSyncComponentsFactoryImpl( |
| 162 this, ::GetChannel(), ::GetVersionString(), | 162 this, ::GetChannel(), ::GetVersionString(), |
| 163 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET, | 163 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET, |
| 164 *base::CommandLine::ForCurrentProcess(), | 164 *base::CommandLine::ForCurrentProcess(), |
| 165 prefs::kSavingBrowserHistoryDisabled, sync_service_url, | 165 prefs::kSavingBrowserHistoryDisabled, sync_service_url, |
| 166 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), | 166 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), |
| 167 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB), | 167 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB), |
| 168 token_service, url_request_context_getter, web_data_service_, | 168 token_service, url_request_context_getter, web_data_service_, |
| 169 password_store_)); | 169 password_store_)); |
| 170 } | 170 } |
| 171 } | 171 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 // static | 391 // static |
| 392 void IOSChromeSyncClient::GetDeviceInfoTrackers( | 392 void IOSChromeSyncClient::GetDeviceInfoTrackers( |
| 393 std::vector<const sync_driver::DeviceInfoTracker*>* trackers) { | 393 std::vector<const sync_driver::DeviceInfoTracker*>* trackers) { |
| 394 DCHECK(trackers); | 394 DCHECK(trackers); |
| 395 std::vector<ios::ChromeBrowserState*> browser_state_list = | 395 std::vector<ios::ChromeBrowserState*> browser_state_list = |
| 396 GetApplicationContext() | 396 GetApplicationContext() |
| 397 ->GetChromeBrowserStateManager() | 397 ->GetChromeBrowserStateManager() |
| 398 ->GetLoadedBrowserStates(); | 398 ->GetLoadedBrowserStates(); |
| 399 for (ios::ChromeBrowserState* browser_state : browser_state_list) { | 399 for (ios::ChromeBrowserState* browser_state : browser_state_list) { |
| 400 ProfileSyncService* profile_sync_service = | 400 browser_sync::ProfileSyncService* profile_sync_service = |
| 401 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); | 401 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); |
| 402 if (profile_sync_service != nullptr) { | 402 if (profile_sync_service != nullptr) { |
| 403 const sync_driver::DeviceInfoTracker* tracker = | 403 const sync_driver::DeviceInfoTracker* tracker = |
| 404 profile_sync_service->GetDeviceInfoTracker(); | 404 profile_sync_service->GetDeviceInfoTracker(); |
| 405 if (tracker != nullptr) { | 405 if (tracker != nullptr) { |
| 406 trackers->push_back(tracker); | 406 trackers->push_back(tracker); |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 } | 410 } |
| OLD | NEW |