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 "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 credentials, | 426 credentials, |
427 delete_sync_data_folder, | 427 delete_sync_data_folder, |
428 notifier_options_); | 428 notifier_options_); |
429 } | 429 } |
430 | 430 |
431 void ProfileSyncService::CreateBackend() { | 431 void ProfileSyncService::CreateBackend() { |
432 backend_.reset(new SyncBackendHost(profile_)); | 432 backend_.reset(new SyncBackendHost(profile_)); |
433 } | 433 } |
434 | 434 |
435 bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { | 435 bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { |
436 return encrypted_types_.size() > 0; | 436 return !encrypted_types_.empty(); |
437 } | 437 } |
438 | 438 |
439 void ProfileSyncService::StartUp() { | 439 void ProfileSyncService::StartUp() { |
440 // Don't start up multiple times. | 440 // Don't start up multiple times. |
441 if (backend_.get()) { | 441 if (backend_.get()) { |
442 VLOG(1) << "Skipping bringing up backend host."; | 442 VLOG(1) << "Skipping bringing up backend host."; |
443 return; | 443 return; |
444 } | 444 } |
445 | 445 |
446 DCHECK(AreCredentialsAvailable()); | 446 DCHECK(AreCredentialsAvailable()); |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 // is initialized, all enabled data types are consistent with one | 1348 // is initialized, all enabled data types are consistent with one |
1349 // another, and no unrecoverable error has transpired. | 1349 // another, and no unrecoverable error has transpired. |
1350 if (unrecoverable_error_detected_) | 1350 if (unrecoverable_error_detected_) |
1351 return false; | 1351 return false; |
1352 | 1352 |
1353 if (!data_type_manager_.get()) | 1353 if (!data_type_manager_.get()) |
1354 return false; | 1354 return false; |
1355 | 1355 |
1356 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1356 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
1357 } | 1357 } |
OLD | NEW |