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

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: Rebase + small fix 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // SyncFrontend implementation. 183 // SyncFrontend implementation.
184 virtual void OnBackendInitialized(); 184 virtual void OnBackendInitialized();
185 virtual void OnSyncCycleCompleted(); 185 virtual void OnSyncCycleCompleted();
186 virtual void OnAuthError(); 186 virtual void OnAuthError();
187 virtual void OnStopSyncingPermanently(); 187 virtual void OnStopSyncingPermanently();
188 virtual void OnClearServerDataFailed(); 188 virtual void OnClearServerDataFailed();
189 virtual void OnClearServerDataTimeout(); 189 virtual void OnClearServerDataTimeout();
190 virtual void OnClearServerDataSucceeded(); 190 virtual void OnClearServerDataSucceeded();
191 virtual void OnPassphraseRequired(bool for_decryption); 191 virtual void OnPassphraseRequired(bool for_decryption);
192 virtual void OnPassphraseAccepted(); 192 virtual void OnPassphraseAccepted();
193 virtual void OnEncryptionComplete(
194 const syncable::ModelTypeSet& encrypted_types);
193 195
194 // Called when a user enters credentials through UI. 196 // Called when a user enters credentials through UI.
195 virtual void OnUserSubmittedAuth(const std::string& username, 197 virtual void OnUserSubmittedAuth(const std::string& username,
196 const std::string& password, 198 const std::string& password,
197 const std::string& captcha, 199 const std::string& captcha,
198 const std::string& access_code); 200 const std::string& access_code);
199 201
200 // Update the last auth error and notify observers of error state. 202 // Update the last auth error and notify observers of error state.
201 void UpdateAuthErrorState(const GoogleServiceAuthError& error); 203 void UpdateAuthErrorState(const GoogleServiceAuthError& error);
202 204
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 // setting a passphrase as opposed to implicitly (from the users' perspective) 429 // setting a passphrase as opposed to implicitly (from the users' perspective)
428 // using their Google Account password. An implicit SetPassphrase will *not* 430 // using their Google Account password. An implicit SetPassphrase will *not*
429 // *not* override an explicit passphrase set previously. 431 // *not* override an explicit passphrase set previously.
430 // |is_creation| is true if the call is in response to the user setting 432 // |is_creation| is true if the call is in response to the user setting
431 // up a new passphrase, and false if it's being set in response to a prompt 433 // up a new passphrase, and false if it's being set in response to a prompt
432 // for an existing passphrase. 434 // for an existing passphrase.
433 virtual void SetPassphrase(const std::string& passphrase, 435 virtual void SetPassphrase(const std::string& passphrase,
434 bool is_explicit, 436 bool is_explicit,
435 bool is_creation); 437 bool is_creation);
436 438
439 // Changes the set of datatypes that require encryption. This affects all
440 // machines synced to this account and all data belonging to the specified
441 // types.
442 // Note that this is an asynchronous operation (the encryption of data is
443 // performed on SyncBackendHost's core thread) and may not have an immediate
444 // effect.
445 virtual void EncryptDataTypes(
446 const syncable::ModelTypeSet& encrypted_types);
447
448 // Get the currently encrypted data types.
449 virtual void GetEncryptedDataTypes(
450 syncable::ModelTypeSet* encrypted_types) const;
451
437 // Returns whether processing changes is allowed. Check this before doing 452 // Returns whether processing changes is allowed. Check this before doing
438 // any model-modifying operations. 453 // any model-modifying operations.
439 bool ShouldPushChanges(); 454 bool ShouldPushChanges();
440 455
441 const GURL& sync_service_url() const { return sync_service_url_; } 456 const GURL& sync_service_url() const { return sync_service_url_; }
442 SigninManager* signin() { return signin_.get(); } 457 SigninManager* signin() { return signin_.get(); }
443 const std::string& cros_user() const { return cros_user_; } 458 const std::string& cros_user() const { return cros_user_; }
444 459
445 protected: 460 protected:
446 // Used by ProfileSyncServiceMock only. 461 // Used by ProfileSyncServiceMock only.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 // Keep track of where we are in a server clear operation 648 // Keep track of where we are in a server clear operation
634 ClearServerDataState clear_server_data_state_; 649 ClearServerDataState clear_server_data_state_;
635 650
636 // Timeout for the clear data command. This timeout is a temporary hack 651 // Timeout for the clear data command. This timeout is a temporary hack
637 // and is necessary because the nudge sync framework can drop nudges for 652 // and is necessary because the nudge sync framework can drop nudges for
638 // a wide variety of sync-related conditions (throttling, connections issues, 653 // a wide variety of sync-related conditions (throttling, connections issues,
639 // syncer paused, etc.). It can only be removed correctly when the framework 654 // syncer paused, etc.). It can only be removed correctly when the framework
640 // is reworked to allow one-shot commands like clearing server data. 655 // is reworked to allow one-shot commands like clearing server data.
641 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; 656 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_;
642 657
658 // The set of encrypted types. This is updated whenever datatypes are
659 // encrypted through the OnEncryptionComplete callback of SyncFrontend.
660 syncable::ModelTypeSet encrypted_types_;
661
643 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 662 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
644 }; 663 };
645 664
646 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 665 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/js_sync_manager_observer_unittest.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698