| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/sync/glue/sync_start_util.h" | 5 #include "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 "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 DVLOG(2) << "No ProfileManager, can't start sync."; | 23 DVLOG(2) << "No ProfileManager, can't start sync."; |
| 24 return; | 24 return; |
| 25 } | 25 } |
| 26 | 26 |
| 27 Profile* p = profile_manager->GetProfileByPath(profile); | 27 Profile* p = profile_manager->GetProfileByPath(profile); |
| 28 if (!p) { | 28 if (!p) { |
| 29 DVLOG(2) << "Profile not found, can't start sync."; | 29 DVLOG(2) << "Profile not found, can't start sync."; |
| 30 return; | 30 return; |
| 31 } | 31 } |
| 32 | 32 |
| 33 ProfileSyncService* service = ProfileSyncServiceFactory::GetForProfile(p); | 33 browser_sync::ProfileSyncService* service = |
| 34 ProfileSyncServiceFactory::GetForProfile(p); |
| 34 if (!service) { | 35 if (!service) { |
| 35 DVLOG(2) << "No ProfileSyncService for profile, can't start sync."; | 36 DVLOG(2) << "No ProfileSyncService for profile, can't start sync."; |
| 36 return; | 37 return; |
| 37 } | 38 } |
| 38 service->OnDataTypeRequestsSyncStartup(type); | 39 service->OnDataTypeRequestsSyncStartup(type); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void StartSyncProxy(const base::FilePath& profile, | 42 void StartSyncProxy(const base::FilePath& profile, |
| 42 syncer::ModelType type) { | 43 syncer::ModelType type) { |
| 43 content::BrowserThread::PostTask( | 44 content::BrowserThread::PostTask( |
| 44 content::BrowserThread::UI, FROM_HERE, | 45 content::BrowserThread::UI, FROM_HERE, |
| 45 base::Bind(&StartSyncOnUIThread, profile, type)); | 46 base::Bind(&StartSyncOnUIThread, profile, type)); |
| 46 } | 47 } |
| 47 | 48 |
| 48 } // namespace | 49 } // namespace |
| 49 | 50 |
| 50 namespace sync_start_util { | 51 namespace sync_start_util { |
| 51 | 52 |
| 52 syncer::SyncableService::StartSyncFlare GetFlareForSyncableService( | 53 syncer::SyncableService::StartSyncFlare GetFlareForSyncableService( |
| 53 const base::FilePath& profile_path) { | 54 const base::FilePath& profile_path) { |
| 54 return base::Bind(&StartSyncProxy, profile_path); | 55 return base::Bind(&StartSyncProxy, profile_path); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace sync_start_util | 58 } // namespace sync_start_util |
| OLD | NEW |