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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 << kLiveSyncOperationTimeoutMs / 1000 | 867 << kLiveSyncOperationTimeoutMs / 1000 |
868 << " seconds."; | 868 << " seconds."; |
869 return false; | 869 return false; |
870 } | 870 } |
871 return IsTypeEncrypted(type); | 871 return IsTypeEncrypted(type); |
872 } | 872 } |
873 | 873 |
874 bool ProfileSyncServiceHarness::IsTypeEncrypted(syncable::ModelType type) { | 874 bool ProfileSyncServiceHarness::IsTypeEncrypted(syncable::ModelType type) { |
875 syncable::ModelTypeSet encrypted_types; | 875 syncable::ModelTypeSet encrypted_types; |
876 service_->GetEncryptedDataTypes(&encrypted_types); | 876 service_->GetEncryptedDataTypes(&encrypted_types); |
877 if (encrypted_types.count(type) == 0) { | 877 return (encrypted_types.count(type) != 0); |
878 return false; | 878 } |
879 } | 879 |
880 return true; | 880 bool ProfileSyncServiceHarness::IsTypeRegistered(syncable::ModelType type) { |
| 881 syncable::ModelTypeSet registered_types; |
| 882 service_->GetRegisteredDataTypes(®istered_types); |
| 883 return (registered_types.count(type) != 0); |
| 884 } |
| 885 |
| 886 bool ProfileSyncServiceHarness::IsTypePreferred(syncable::ModelType type) { |
| 887 syncable::ModelTypeSet synced_types; |
| 888 service_->GetPreferredDataTypes(&synced_types); |
| 889 return (synced_types.count(type) != 0); |
881 } | 890 } |
882 | 891 |
883 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 892 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
884 DictionaryValue value; | 893 DictionaryValue value; |
885 sync_ui_util::ConstructAboutInformation(service_, &value); | 894 sync_ui_util::ConstructAboutInformation(service_, &value); |
886 std::string service_status; | 895 std::string service_status; |
887 base::JSONWriter::Write(&value, true, &service_status); | 896 base::JSONWriter::Write(&value, true, &service_status); |
888 return service_status; | 897 return service_status; |
889 } | 898 } |
OLD | NEW |