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

Side by Side Diff: chrome/browser/sync/profile_sync_service.h

Issue 665223007: Add a flag to ProfileSyncService that says whether encrypting all data is allowed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years, 1 month 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
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 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 // passphrase with this API. 660 // passphrase with this API.
661 virtual void SetEncryptionPassphrase(const std::string& passphrase, 661 virtual void SetEncryptionPassphrase(const std::string& passphrase,
662 PassphraseType type); 662 PassphraseType type);
663 663
664 // Asynchronously decrypts pending keys using |passphrase|. Returns false 664 // Asynchronously decrypts pending keys using |passphrase|. Returns false
665 // immediately if the passphrase could not be used to decrypt a locally cached 665 // immediately if the passphrase could not be used to decrypt a locally cached
666 // copy of encrypted keys; returns true otherwise. 666 // copy of encrypted keys; returns true otherwise.
667 virtual bool SetDecryptionPassphrase(const std::string& passphrase) 667 virtual bool SetDecryptionPassphrase(const std::string& passphrase)
668 WARN_UNUSED_RESULT; 668 WARN_UNUSED_RESULT;
669 669
670 // Returns true if encrypting all the sync data is allowed. If this method
671 // returns false, EnableEncryptEverything() should not be called.
672 virtual bool EncryptEverythingAllowed() const;
673
674 // Sets whether encrypting all the sync data is allowed or not.
675 virtual void SetEncryptEverythingAllowed(bool allowed);
676
670 // Turns on encryption for all data. Callers must call OnUserChoseDatatypes() 677 // Turns on encryption for all data. Callers must call OnUserChoseDatatypes()
671 // after calling this to force the encryption to occur. 678 // after calling this to force the encryption to occur.
672 virtual void EnableEncryptEverything(); 679 virtual void EnableEncryptEverything();
673 680
674 // Returns true if we are currently set to encrypt all the sync data. Note: 681 // Returns true if we are currently set to encrypt all the sync data. Note:
675 // this is based on the cryptographer's settings, so if the user has recently 682 // this is based on the cryptographer's settings, so if the user has recently
676 // requested encryption to be turned on, this may not be true yet. For that, 683 // requested encryption to be turned on, this may not be true yet. For that,
677 // encryption_pending() must be checked. 684 // encryption_pending() must be checked.
678 virtual bool EncryptEverythingEnabled() const; 685 virtual bool EncryptEverythingEnabled() const;
679 686
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 // Sometimes we need to temporarily hold on to a passphrase because we don't 1046 // Sometimes we need to temporarily hold on to a passphrase because we don't
1040 // yet have a backend to send it to. This happens during initialization as 1047 // yet have a backend to send it to. This happens during initialization as
1041 // we don't StartUp until we have a valid token, which happens after valid 1048 // we don't StartUp until we have a valid token, which happens after valid
1042 // credentials were provided. 1049 // credentials were provided.
1043 std::string cached_passphrase_; 1050 std::string cached_passphrase_;
1044 1051
1045 // The current set of encrypted types. Always a superset of 1052 // The current set of encrypted types. Always a superset of
1046 // syncer::Cryptographer::SensitiveTypes(). 1053 // syncer::Cryptographer::SensitiveTypes().
1047 syncer::ModelTypeSet encrypted_types_; 1054 syncer::ModelTypeSet encrypted_types_;
1048 1055
1056 // Whether encrypting everything is allowed.
1057 bool encrypt_everything_allowed_;
1058
1049 // Whether we want to encrypt everything. 1059 // Whether we want to encrypt everything.
1050 bool encrypt_everything_; 1060 bool encrypt_everything_;
1051 1061
1052 // Whether we're waiting for an attempt to encryption all sync data to 1062 // Whether we're waiting for an attempt to encryption all sync data to
1053 // complete. We track this at this layer in order to allow the user to cancel 1063 // complete. We track this at this layer in order to allow the user to cancel
1054 // if they e.g. don't remember their explicit passphrase. 1064 // if they e.g. don't remember their explicit passphrase.
1055 bool encryption_pending_; 1065 bool encryption_pending_;
1056 1066
1057 scoped_ptr<browser_sync::BackendMigrator> migrator_; 1067 scoped_ptr<browser_sync::BackendMigrator> migrator_;
1058 1068
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 BrowsingDataRemover::Observer* browsing_data_remover_observer_; 1161 BrowsingDataRemover::Observer* browsing_data_remover_observer_;
1152 1162
1153 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 1163 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
1154 }; 1164 };
1155 1165
1156 bool ShouldShowActionOnUI( 1166 bool ShouldShowActionOnUI(
1157 const syncer::SyncProtocolError& error); 1167 const syncer::SyncProtocolError& error);
1158 1168
1159 1169
1160 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 1170 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698