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

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

Issue 7669073: [Sync] Add support for enabling session sync remotely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DOUBLE R..ebase Created 9 years, 3 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) 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
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(&registered_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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/browser/sync/protocol/nigori_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698