| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sync/sessions/model_type_registry.h" | 5 #include "sync/sessions/model_type_registry.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "sync/engine/directory_commit_contributor.h" | 10 #include "sync/engine/directory_commit_contributor.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 void ModelTypeRegistry::OnCryptographerStateChanged( | 326 void ModelTypeRegistry::OnCryptographerStateChanged( |
| 327 Cryptographer* cryptographer) { | 327 Cryptographer* cryptographer) { |
| 328 cryptographer_.reset(new Cryptographer(*cryptographer)); | 328 cryptographer_.reset(new Cryptographer(*cryptographer)); |
| 329 OnEncryptionStateChanged(); | 329 OnEncryptionStateChanged(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void ModelTypeRegistry::OnPassphraseTypeChanged(PassphraseType type, | 332 void ModelTypeRegistry::OnPassphraseTypeChanged(PassphraseType type, |
| 333 base::Time passphrase_time) { | 333 base::Time passphrase_time) { |
| 334 } | 334 } |
| 335 | 335 |
| 336 void ModelTypeRegistry::OnLocalSetCustomPassphrase( |
| 337 const SyncEncryptionHandler::NigoriState& nigori_state) { |
| 338 } |
| 339 |
| 336 ModelTypeSet ModelTypeRegistry::GetEnabledDirectoryTypes() const { | 340 ModelTypeSet ModelTypeRegistry::GetEnabledDirectoryTypes() const { |
| 337 return enabled_directory_types_; | 341 return enabled_directory_types_; |
| 338 } | 342 } |
| 339 | 343 |
| 340 void ModelTypeRegistry::OnEncryptionStateChanged() { | 344 void ModelTypeRegistry::OnEncryptionStateChanged() { |
| 341 for (ScopedVector<ModelTypeSyncWorkerImpl>::iterator it = | 345 for (ScopedVector<ModelTypeSyncWorkerImpl>::iterator it = |
| 342 model_type_sync_workers_.begin(); | 346 model_type_sync_workers_.begin(); |
| 343 it != model_type_sync_workers_.end(); | 347 it != model_type_sync_workers_.end(); |
| 344 ++it) { | 348 ++it) { |
| 345 if (encrypted_types_.Has((*it)->GetModelType())) { | 349 if (encrypted_types_.Has((*it)->GetModelType())) { |
| 346 (*it)->UpdateCryptographer( | 350 (*it)->UpdateCryptographer( |
| 347 make_scoped_ptr(new Cryptographer(*cryptographer_))); | 351 make_scoped_ptr(new Cryptographer(*cryptographer_))); |
| 348 } | 352 } |
| 349 } | 353 } |
| 350 } | 354 } |
| 351 | 355 |
| 352 ModelTypeSet ModelTypeRegistry::GetEnabledNonBlockingTypes() const { | 356 ModelTypeSet ModelTypeRegistry::GetEnabledNonBlockingTypes() const { |
| 353 ModelTypeSet enabled_off_thread_types; | 357 ModelTypeSet enabled_off_thread_types; |
| 354 for (ScopedVector<ModelTypeSyncWorkerImpl>::const_iterator it = | 358 for (ScopedVector<ModelTypeSyncWorkerImpl>::const_iterator it = |
| 355 model_type_sync_workers_.begin(); | 359 model_type_sync_workers_.begin(); |
| 356 it != model_type_sync_workers_.end(); | 360 it != model_type_sync_workers_.end(); |
| 357 ++it) { | 361 ++it) { |
| 358 enabled_off_thread_types.Put((*it)->GetModelType()); | 362 enabled_off_thread_types.Put((*it)->GetModelType()); |
| 359 } | 363 } |
| 360 return enabled_off_thread_types; | 364 return enabled_off_thread_types; |
| 361 } | 365 } |
| 362 | 366 |
| 363 } // namespace syncer | 367 } // namespace syncer |
| OLD | NEW |