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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // TODO(akalin): Shouldn't this belong with the intersection check? | 838 // TODO(akalin): Shouldn't this belong with the intersection check? |
839 // Otherwise, this function isn't symmetric. | 839 // Otherwise, this function isn't symmetric. |
840 if (!IsFullySynced()) { | 840 if (!IsFullySynced()) { |
841 DVLOG(2) << profile_debug_name_ << ": not synced, assuming doesn't match"; | 841 DVLOG(2) << profile_debug_name_ << ": not synced, assuming doesn't match"; |
842 return false; | 842 return false; |
843 } | 843 } |
844 | 844 |
845 // Only look for a match if we have at least one enabled datatype in | 845 // Only look for a match if we have at least one enabled datatype in |
846 // common with the partner client. | 846 // common with the partner client. |
847 const syncer::ModelTypeSet common_types = | 847 const syncer::ModelTypeSet common_types = |
848 Intersection(service()->GetPreferredDataTypes(), | 848 Intersection(service()->GetActiveDataTypes(), |
849 partner->service()->GetPreferredDataTypes()); | 849 partner->service()->GetActiveDataTypes()); |
850 | 850 |
851 DVLOG(2) << profile_debug_name_ << ", " << partner->profile_debug_name_ | 851 DVLOG(2) << profile_debug_name_ << ", " << partner->profile_debug_name_ |
852 << ": common types are " | 852 << ": common types are " |
853 << syncer::ModelTypeSetToString(common_types); | 853 << syncer::ModelTypeSetToString(common_types); |
854 | 854 |
855 if (!common_types.Empty() && !partner->IsFullySynced()) { | 855 if (!common_types.Empty() && !partner->IsFullySynced()) { |
856 DVLOG(2) << "non-empty common types and " | 856 DVLOG(2) << "non-empty common types and " |
857 << partner->profile_debug_name_ << " isn't synced"; | 857 << partner->profile_debug_name_ << " isn't synced"; |
858 return false; | 858 return false; |
859 } | 859 } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 | 1127 |
1128 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 1128 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
1129 scoped_ptr<DictionaryValue> value( | 1129 scoped_ptr<DictionaryValue> value( |
1130 sync_ui_util::ConstructAboutInformation(service_)); | 1130 sync_ui_util::ConstructAboutInformation(service_)); |
1131 std::string service_status; | 1131 std::string service_status; |
1132 base::JSONWriter::WriteWithOptions(value.get(), | 1132 base::JSONWriter::WriteWithOptions(value.get(), |
1133 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 1133 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
1134 &service_status); | 1134 &service_status); |
1135 return service_status; | 1135 return service_status; |
1136 } | 1136 } |
OLD | NEW |