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

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

Issue 8356026: [Sync] Cache encrypted types info in ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failures Created 9 years, 2 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 #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 <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // SyncFrontend implementation. 200 // SyncFrontend implementation.
201 virtual void OnBackendInitialized( 201 virtual void OnBackendInitialized(
202 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, 202 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend,
203 bool success) OVERRIDE; 203 bool success) OVERRIDE;
204 virtual void OnSyncCycleCompleted() OVERRIDE; 204 virtual void OnSyncCycleCompleted() OVERRIDE;
205 virtual void OnAuthError() OVERRIDE; 205 virtual void OnAuthError() OVERRIDE;
206 virtual void OnStopSyncingPermanently() OVERRIDE; 206 virtual void OnStopSyncingPermanently() OVERRIDE;
207 virtual void OnClearServerDataFailed() OVERRIDE; 207 virtual void OnClearServerDataFailed() OVERRIDE;
208 virtual void OnClearServerDataSucceeded() OVERRIDE; 208 virtual void OnClearServerDataSucceeded() OVERRIDE;
209 virtual void OnPassphraseRequired( 209 virtual void OnPassphraseRequired(
210 sync_api::PassphraseRequiredReason reason) OVERRIDE; 210 sync_api::PassphraseRequiredReason reason) OVERRIDE;
Nicolas Zea 2011/10/20 18:40:41 I think we may need to send the set of encrypted t
akalin 2011/10/21 02:24:17 Right. Added new notification OnEncryptedTypesCha
211 virtual void OnPassphraseAccepted() OVERRIDE; 211 virtual void OnPassphraseAccepted() OVERRIDE;
212 virtual void OnEncryptionComplete( 212 virtual void OnEncryptionComplete(
213 const syncable::ModelTypeSet& encrypted_types) OVERRIDE; 213 const syncable::ModelTypeSet& encrypted_types,
214 bool encrypt_everything) OVERRIDE;
214 virtual void OnMigrationNeededForTypes( 215 virtual void OnMigrationNeededForTypes(
215 const syncable::ModelTypeSet& types) OVERRIDE; 216 const syncable::ModelTypeSet& types) OVERRIDE;
216 virtual void OnDataTypesChanged( 217 virtual void OnDataTypesChanged(
217 const syncable::ModelTypeSet& to_add) OVERRIDE; 218 const syncable::ModelTypeSet& to_add) OVERRIDE;
218 virtual void OnActionableError( 219 virtual void OnActionableError(
219 const browser_sync::SyncProtocolError& error) OVERRIDE; 220 const browser_sync::SyncProtocolError& error) OVERRIDE;
220 221
221 void OnClearServerDataTimeout(); 222 void OnClearServerDataTimeout();
222 223
223 // Called when a user enters credentials through UI. 224 // Called when a user enters credentials through UI.
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // Keep track of where we are in a server clear operation 664 // Keep track of where we are in a server clear operation
664 ClearServerDataState clear_server_data_state_; 665 ClearServerDataState clear_server_data_state_;
665 666
666 // Timeout for the clear data command. This timeout is a temporary hack 667 // Timeout for the clear data command. This timeout is a temporary hack
667 // and is necessary because the nudge sync framework can drop nudges for 668 // and is necessary because the nudge sync framework can drop nudges for
668 // a wide variety of sync-related conditions (throttling, connections issues, 669 // a wide variety of sync-related conditions (throttling, connections issues,
669 // syncer paused, etc.). It can only be removed correctly when the framework 670 // syncer paused, etc.). It can only be removed correctly when the framework
670 // is reworked to allow one-shot commands like clearing server data. 671 // is reworked to allow one-shot commands like clearing server data.
671 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_; 672 base::OneShotTimer<ProfileSyncService> clear_server_data_timer_;
672 673
674 // The set of encrypted types and whether or not we want to encrypt
675 // everything. Initialized on OnBackendInitialized and updated by
676 // OnEncryptionComplete.
677 syncable::ModelTypeSet encrypted_types_;
678 bool encrypt_everything_;
679
673 // Whether we're waiting for an attempt to encryption all sync data to 680 // Whether we're waiting for an attempt to encryption all sync data to
674 // complete. We track this at this layer in order to allow the user to cancel 681 // complete. We track this at this layer in order to allow the user to cancel
675 // if they e.g. don't remember their explicit passphrase. 682 // if they e.g. don't remember their explicit passphrase.
676 bool encryption_pending_; 683 bool encryption_pending_;
677 684
678 // If true, we want to automatically start sync signin whenever we have 685 // If true, we want to automatically start sync signin whenever we have
679 // credentials (user doesn't need to go through the startup flow). This is 686 // credentials (user doesn't need to go through the startup flow). This is
680 // typically enabled on platforms (like ChromeOS) that have their own 687 // typically enabled on platforms (like ChromeOS) that have their own
681 // distinct signin flow. 688 // distinct signin flow.
682 bool auto_start_enabled_; 689 bool auto_start_enabled_;
(...skipping 11 matching lines...) Expand all
694 FailedDatatypesHandler failed_datatypes_handler_; 701 FailedDatatypesHandler failed_datatypes_handler_;
695 702
696 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 703 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
697 }; 704 };
698 705
699 bool ShouldShowActionOnUI( 706 bool ShouldShowActionOnUI(
700 const browser_sync::SyncProtocolError& error); 707 const browser_sync::SyncProtocolError& error);
701 708
702 709
703 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ 710 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698