OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 if (!host_) | 484 if (!host_) |
485 return; | 485 return; |
486 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 486 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
487 TokenAvailableDetails details(GaiaConstants::kSyncService, token); | 487 TokenAvailableDetails details(GaiaConstants::kSyncService, token); |
488 NotificationService::current()->Notify( | 488 NotificationService::current()->Notify( |
489 NotificationType::TOKEN_UPDATED, | 489 NotificationType::TOKEN_UPDATED, |
490 NotificationService::AllSources(), | 490 NotificationService::AllSources(), |
491 Details<const TokenAvailableDetails>(&details)); | 491 Details<const TokenAvailableDetails>(&details)); |
492 } | 492 } |
493 | 493 |
| 494 SyncBackendHost::Core::DoInitializeOptions::DoInitializeOptions( |
| 495 const GURL& service_url, |
| 496 sync_api::HttpPostProviderFactory* http_bridge_factory, |
| 497 const sync_api::SyncCredentials& credentials, |
| 498 bool delete_sync_data_folder, |
| 499 const notifier::NotifierOptions& notifier_options, |
| 500 std::string restored_key_for_bootstrapping, |
| 501 bool setup_for_test_mode) |
| 502 : service_url(service_url), |
| 503 http_bridge_factory(http_bridge_factory), |
| 504 credentials(credentials), |
| 505 delete_sync_data_folder(delete_sync_data_folder), |
| 506 notifier_options(notifier_options), |
| 507 restored_key_for_bootstrapping(restored_key_for_bootstrapping), |
| 508 setup_for_test_mode(setup_for_test_mode) { |
| 509 } |
| 510 |
| 511 SyncBackendHost::Core::DoInitializeOptions::~DoInitializeOptions() {} |
| 512 |
494 sync_api::UserShare* SyncBackendHost::GetUserShare() const { | 513 sync_api::UserShare* SyncBackendHost::GetUserShare() const { |
495 DCHECK(syncapi_initialized_); | 514 DCHECK(syncapi_initialized_); |
496 return core_->syncapi()->GetUserShare(); | 515 return core_->syncapi()->GetUserShare(); |
497 } | 516 } |
498 | 517 |
499 SyncBackendHost::Status SyncBackendHost::GetDetailedStatus() { | 518 SyncBackendHost::Status SyncBackendHost::GetDetailedStatus() { |
500 DCHECK(syncapi_initialized_); | 519 DCHECK(syncapi_initialized_); |
501 return core_->syncapi()->GetDetailedStatus(); | 520 return core_->syncapi()->GetDetailedStatus(); |
502 } | 521 } |
503 | 522 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 } | 916 } |
898 | 917 |
899 void SyncBackendHost::Core::DeleteSyncDataFolder() { | 918 void SyncBackendHost::Core::DeleteSyncDataFolder() { |
900 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { | 919 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { |
901 if (!file_util::Delete(host_->sync_data_folder_path(), true)) | 920 if (!file_util::Delete(host_->sync_data_folder_path(), true)) |
902 LOG(DFATAL) << "Could not delete the Sync Data folder."; | 921 LOG(DFATAL) << "Could not delete the Sync Data folder."; |
903 } | 922 } |
904 } | 923 } |
905 | 924 |
906 } // namespace browser_sync | 925 } // namespace browser_sync |
OLD | NEW |