| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 return; | 703 return; |
| 704 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 704 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
| 705 | 705 |
| 706 host_->last_snapshot_.reset(snapshot); | 706 host_->last_snapshot_.reset(snapshot); |
| 707 | 707 |
| 708 const syncable::ModelTypeSet& to_migrate = | 708 const syncable::ModelTypeSet& to_migrate = |
| 709 snapshot->syncer_status.types_needing_local_migration; | 709 snapshot->syncer_status.types_needing_local_migration; |
| 710 if (!to_migrate.empty()) | 710 if (!to_migrate.empty()) |
| 711 host_->frontend_->OnMigrationNeededForTypes(to_migrate); | 711 host_->frontend_->OnMigrationNeededForTypes(to_migrate); |
| 712 | 712 |
| 713 // Process any changes to the datatypes we're syncing. |
| 714 // TODO(sync): add support for removing types. |
| 715 syncable::ModelTypeSet to_add; |
| 716 if (host_->initialized() && |
| 717 sync_manager()->ReceivedExperimentalTypes(&to_add)) { |
| 718 host_->frontend_->OnDataTypesChanged(to_add); |
| 719 } |
| 720 |
| 713 // If we are waiting for a configuration change, check here to see | 721 // If we are waiting for a configuration change, check here to see |
| 714 // if this sync cycle has initialized all of the types we've been | 722 // if this sync cycle has initialized all of the types we've been |
| 715 // waiting for. | 723 // waiting for. |
| 716 if (host_->pending_download_state_.get()) { | 724 if (host_->pending_download_state_.get()) { |
| 717 scoped_ptr<PendingConfigureDataTypesState> state( | 725 scoped_ptr<PendingConfigureDataTypesState> state( |
| 718 host_->pending_download_state_.release()); | 726 host_->pending_download_state_.release()); |
| 719 DCHECK( | 727 DCHECK( |
| 720 std::includes(state->types_to_add.begin(), state->types_to_add.end(), | 728 std::includes(state->types_to_add.begin(), state->types_to_add.end(), |
| 721 state->added_types.begin(), state->added_types.end())); | 729 state->added_types.begin(), state->added_types.end())); |
| 722 syncable::ModelTypeBitSet added_types = | 730 syncable::ModelTypeBitSet added_types = |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 } | 896 } |
| 889 | 897 |
| 890 void SyncBackendHost::Core::DeleteSyncDataFolder() { | 898 void SyncBackendHost::Core::DeleteSyncDataFolder() { |
| 891 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { | 899 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { |
| 892 if (!file_util::Delete(host_->sync_data_folder_path(), true)) | 900 if (!file_util::Delete(host_->sync_data_folder_path(), true)) |
| 893 LOG(DFATAL) << "Could not delete the Sync Data folder."; | 901 LOG(DFATAL) << "Could not delete the Sync Data folder."; |
| 894 } | 902 } |
| 895 } | 903 } |
| 896 | 904 |
| 897 } // namespace browser_sync | 905 } // namespace browser_sync |
| OLD | NEW |