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_harness.h" | 5 #include "chrome/browser/sync/profile_sync_service_harness.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <ostream> | 10 #include <ostream> |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
998 (syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE)); | 998 (syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE)); |
999 service_->OnUserChoseDatatypes(sync_everything, | 999 service_->OnUserChoseDatatypes(sync_everything, |
1000 synced_datatypes); | 1000 synced_datatypes); |
1001 | 1001 |
1002 // Wait some time to let the enryption finish. | 1002 // Wait some time to let the enryption finish. |
1003 return WaitForTypeEncryption(type); | 1003 return WaitForTypeEncryption(type); |
1004 } | 1004 } |
1005 | 1005 |
1006 bool ProfileSyncServiceHarness::WaitForTypeEncryption( | 1006 bool ProfileSyncServiceHarness::WaitForTypeEncryption( |
1007 syncable::ModelType type) { | 1007 syncable::ModelType type) { |
1008 // TODO(rlarocque): The correctness of this if condition depends on the | |
akalin
2011/09/22 19:13:47
It's not clear what the TODO is. Suggest:
// The
rlarocque
2011/09/22 19:21:38
Done.
| |
1009 // ordering of its sub-expressions. See crbug.com/95619. | |
1008 if (IsTypeEncrypted(type) && | 1010 if (IsTypeEncrypted(type) && |
1009 IsSynced() && | 1011 IsSynced() && |
1010 GetLastSessionSnapshot()->num_conflicting_updates == 0) { | 1012 GetLastSessionSnapshot()->num_conflicting_updates == 0) { |
1011 // Encryption is already complete for |type|; do not wait. | 1013 // Encryption is already complete for |type|; do not wait. |
1012 return true; | 1014 return true; |
1013 } | 1015 } |
1014 | 1016 |
1015 std::string reason = "Waiting for encryption."; | 1017 std::string reason = "Waiting for encryption."; |
1016 wait_state_ = WAITING_FOR_ENCRYPTION; | 1018 wait_state_ = WAITING_FOR_ENCRYPTION; |
1017 waiting_for_encryption_type_ = type; | 1019 waiting_for_encryption_type_ = type; |
(...skipping 24 matching lines...) Expand all Loading... | |
1042 return (synced_types.count(type) != 0); | 1044 return (synced_types.count(type) != 0); |
1043 } | 1045 } |
1044 | 1046 |
1045 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 1047 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
1046 DictionaryValue value; | 1048 DictionaryValue value; |
1047 sync_ui_util::ConstructAboutInformation(service_, &value); | 1049 sync_ui_util::ConstructAboutInformation(service_, &value); |
1048 std::string service_status; | 1050 std::string service_status; |
1049 base::JSONWriter::Write(&value, true, &service_status); | 1051 base::JSONWriter::Write(&value, true, &service_status); |
1050 return service_status; | 1052 return service_status; |
1051 } | 1053 } |
OLD | NEW |