| 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/glue/sync_start_util.h" | 5 #include "ios/chrome/browser/sync/glue/sync_start_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "components/sync_driver/sync_service.h" | 10 #include "components/sync_driver/sync_service.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 syncer::ModelType type) { | 21 syncer::ModelType type) { |
| 22 ios::ChromeBrowserStateManager* browser_state_manager = | 22 ios::ChromeBrowserStateManager* browser_state_manager = |
| 23 GetApplicationContext()->GetChromeBrowserStateManager(); | 23 GetApplicationContext()->GetChromeBrowserStateManager(); |
| 24 if (!browser_state_manager) { | 24 if (!browser_state_manager) { |
| 25 // Can happen in tests. | 25 // Can happen in tests. |
| 26 DVLOG(2) << "No ChromeBrowserStateManager, can't start sync."; | 26 DVLOG(2) << "No ChromeBrowserStateManager, can't start sync."; |
| 27 return; | 27 return; |
| 28 } | 28 } |
| 29 | 29 |
| 30 ios::ChromeBrowserState* browser_state = | 30 ios::ChromeBrowserState* browser_state = |
| 31 browser_state_manager->GetChromeBrowserState(browser_state_path); | 31 browser_state_manager->GetBrowserState(browser_state_path); |
| 32 if (!browser_state) { | 32 if (!browser_state) { |
| 33 DVLOG(2) << "ChromeBrowserState not found, can't start sync."; | 33 DVLOG(2) << "ChromeBrowserState not found, can't start sync."; |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 | 36 |
| 37 sync_driver::SyncService* sync_service = | 37 sync_driver::SyncService* sync_service = |
| 38 ios::GetKeyedServiceProvider()->GetSyncServiceForBrowserState( | 38 ios::GetKeyedServiceProvider()->GetSyncServiceForBrowserState( |
| 39 browser_state); | 39 browser_state); |
| 40 if (!sync_service) { | 40 if (!sync_service) { |
| 41 DVLOG(2) << "No SyncService for browser state, can't start sync."; | 41 DVLOG(2) << "No SyncService for browser state, can't start sync."; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 namespace sync_start_util { | 56 namespace sync_start_util { |
| 57 | 57 |
| 58 syncer::SyncableService::StartSyncFlare GetFlareForSyncableService( | 58 syncer::SyncableService::StartSyncFlare GetFlareForSyncableService( |
| 59 const base::FilePath& browser_state_path) { | 59 const base::FilePath& browser_state_path) { |
| 60 return base::Bind(&StartSyncProxy, browser_state_path); | 60 return base::Bind(&StartSyncProxy, browser_state_path); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace sync_start_util | 63 } // namespace sync_start_util |
| 64 } // namespace ios | 64 } // namespace ios |
| OLD | NEW |