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

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

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // SyncFrontend implementation. 178 // SyncFrontend implementation.
179 virtual void OnBackendInitialized(); 179 virtual void OnBackendInitialized();
180 virtual void OnSyncCycleCompleted(); 180 virtual void OnSyncCycleCompleted();
181 virtual void OnAuthError(); 181 virtual void OnAuthError();
182 virtual void OnStopSyncingPermanently(); 182 virtual void OnStopSyncingPermanently();
183 virtual void OnClearServerDataFailed(); 183 virtual void OnClearServerDataFailed();
184 virtual void OnClearServerDataTimeout(); 184 virtual void OnClearServerDataTimeout();
185 virtual void OnClearServerDataSucceeded(); 185 virtual void OnClearServerDataSucceeded();
186 virtual void OnPassphraseRequired(bool for_decryption); 186 virtual void OnPassphraseRequired(bool for_decryption);
187 virtual void OnPassphraseAccepted(); 187 virtual void OnPassphraseAccepted();
188 virtual void OnEncryptionComplete(
189 const syncable::ModelTypeSet& encrypted_types);
188 190
189 // Called when a user enters credentials through UI. 191 // Called when a user enters credentials through UI.
190 virtual void OnUserSubmittedAuth(const std::string& username, 192 virtual void OnUserSubmittedAuth(const std::string& username,
191 const std::string& password, 193 const std::string& password,
192 const std::string& captcha, 194 const std::string& captcha,
193 const std::string& access_code); 195 const std::string& access_code);
194 196
195 // Update the last auth error and notify observers of error state. 197 // Update the last auth error and notify observers of error state.
196 void UpdateAuthErrorState(const GoogleServiceAuthError& error); 198 void UpdateAuthErrorState(const GoogleServiceAuthError& error);
197 199
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // setting a passphrase as opposed to implicitly (from the users' perspective) 419 // setting a passphrase as opposed to implicitly (from the users' perspective)
418 // using their Google Account password. An implicit SetPassphrase will *not* 420 // using their Google Account password. An implicit SetPassphrase will *not*
419 // *not* override an explicit passphrase set previously. 421 // *not* override an explicit passphrase set previously.
420 // |is_creation| is true if the call is in response to the user setting 422 // |is_creation| is true if the call is in response to the user setting
421 // up a new passphrase, and false if it's being set in response to a prompt 423 // up a new passphrase, and false if it's being set in response to a prompt
422 // for an existing passphrase. 424 // for an existing passphrase.
423 virtual void SetPassphrase(const std::string& passphrase, 425 virtual void SetPassphrase(const std::string& passphrase,
424 bool is_explicit, 426 bool is_explicit,
425 bool is_creation); 427 bool is_creation);
426 428
429 // Changes the set of datatypes that require encryption. This affects all
430 // machines synced to this account and all data belonging to the specified
431 // types. |encrypted_types| must be a subset of the active datatypes.
432 // Note that this is an asynchronous operation (the encryption of data is
433 // performed on SyncBackendHost's core thread) and may not have an immediate
434 // effect.
435 virtual void EncryptDataTypes(
436 const syncable::ModelTypeSet& encrypted_types);
437
438 // Get the currently encrypted data types.
439 virtual void GetEncryptedDataTypes(
440 syncable::ModelTypeSet* encrypted_types) const;
441
427 // Returns whether processing changes is allowed. Check this before doing 442 // Returns whether processing changes is allowed. Check this before doing
428 // any model-modifying operations. 443 // any model-modifying operations.
429 bool ShouldPushChanges(); 444 bool ShouldPushChanges();
430 445
431 const GURL& sync_service_url() const { return sync_service_url_; } 446 const GURL& sync_service_url() const { return sync_service_url_; }
432 SigninManager* signin() { return signin_.get(); } 447 SigninManager* signin() { return signin_.get(); }
433 const std::string& cros_user() const { return cros_user_; } 448 const std::string& cros_user() const { return cros_user_; }
434 449
435 protected: 450 protected:
436 // Used by ProfileSyncServiceMock only. 451 // Used by ProfileSyncServiceMock only.
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 // Keep track of where we are in a server clear operation 636 // Keep track of where we are in a server clear operation
622 ClearServerDataState clear_server_data_state_; 637 ClearServerDataState clear_server_data_state_;
623 638
624 // Timeout for the clear data command. This timeout is a temporary hack 639 // Timeout for the clear data command. This timeout is a temporary hack
625 // and is necessary because the nudge sync framework can drop nudges for 640 // and is necessary because the nudge sync framework can drop nudges for
626 // a wide variety of sync-related conditions (throttling, connections issues, 641 // a wide variety of sync-related conditions (throttling, connections issues,
627 // syncer paused, etc.). It can only be removed correctly when the framework 642 // syncer paused, etc.). It can only be removed correctly when the framework
628 // is reworked to allow one-shot commands like clearing server data. 643 // is reworked to allow one-shot commands like clearing server data.
629 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; 644 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_;
630 645
646 // The set of encrypted types. This is updated whenever datatypes are
647 // encrypted through the OnEncryptionComplete callback of SyncFrontend.
648 syncable::ModelTypeSet encrypted_types_;
649
631 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 650 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
632 }; 651 };
633 652
634 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 653 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698