OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstddef> | 7 #include <cstddef> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <set> | 10 #include <set> |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 } | 955 } |
956 | 956 |
957 syncer::ModelTypeSet synced_datatypes = service()->GetPreferredDataTypes(); | 957 syncer::ModelTypeSet synced_datatypes = service()->GetPreferredDataTypes(); |
958 if (!synced_datatypes.Has(datatype)) { | 958 if (!synced_datatypes.Has(datatype)) { |
959 DVLOG(1) << "DisableSyncForDatatype(): Sync already disabled for datatype " | 959 DVLOG(1) << "DisableSyncForDatatype(): Sync already disabled for datatype " |
960 << syncer::ModelTypeToString(datatype) | 960 << syncer::ModelTypeToString(datatype) |
961 << " on " << profile_debug_name_ << "."; | 961 << " on " << profile_debug_name_ << "."; |
962 return true; | 962 return true; |
963 } | 963 } |
964 | 964 |
| 965 synced_datatypes.RetainAll(syncer::UserSelectableTypes()); |
965 synced_datatypes.Remove(datatype); | 966 synced_datatypes.Remove(datatype); |
966 service()->OnUserChoseDatatypes(false, synced_datatypes); | 967 service()->OnUserChoseDatatypes(false, synced_datatypes); |
967 if (AwaitFullSyncCompletion("Datatype reconfiguration.")) { | 968 if (AwaitFullSyncCompletion("Datatype reconfiguration.")) { |
968 DVLOG(1) << "DisableSyncForDatatype(): Disabled sync for datatype " | 969 DVLOG(1) << "DisableSyncForDatatype(): Disabled sync for datatype " |
969 << syncer::ModelTypeToString(datatype) | 970 << syncer::ModelTypeToString(datatype) |
970 << " on " << profile_debug_name_ << "."; | 971 << " on " << profile_debug_name_ << "."; |
971 return true; | 972 return true; |
972 } | 973 } |
973 | 974 |
974 DVLOG(0) << GetClientInfoString("DisableSyncForDatatype failed"); | 975 DVLOG(0) << GetClientInfoString("DisableSyncForDatatype failed"); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1140 |
1140 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 1141 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
1141 scoped_ptr<DictionaryValue> value( | 1142 scoped_ptr<DictionaryValue> value( |
1142 sync_ui_util::ConstructAboutInformation(service_)); | 1143 sync_ui_util::ConstructAboutInformation(service_)); |
1143 std::string service_status; | 1144 std::string service_status; |
1144 base::JSONWriter::WriteWithOptions(value.get(), | 1145 base::JSONWriter::WriteWithOptions(value.get(), |
1145 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 1146 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
1146 &service_status); | 1147 &service_status); |
1147 return service_status; | 1148 return service_status; |
1148 } | 1149 } |
OLD | NEW |