Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 16105012: Unrevert "[Sync] Split GetPreferredTypes into GetActiveType..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust mock Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_base.h ('k') | chrome/browser/sync/profile_sync_service_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698