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

Unified Diff: chrome/browser/sync/sync_setup_flow.cc

Issue 7056021: Sync: Add encryption customization radio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/sync_setup_flow.h ('k') | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_setup_flow.cc
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 88368bea1744cb8cdc7aad085774d1715c2ce01e..b12425a3fd54493e29fec15f274d5342a2e7975e 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/sync_setup_flow_handler.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -142,6 +143,12 @@ void SyncSetupFlow::GetArgsForConfigure(ProfileSyncService* service,
args->SetBoolean("syncApps",
service->profile()->GetPrefs()->GetBoolean(prefs::kSyncApps));
+ syncable::ModelTypeSet encrypted_types;
+ service->GetEncryptedDataTypes(&encrypted_types);
+ bool encrypt_all = std::equal(
+ encrypted_types.begin(), encrypted_types.end(), registered_types.begin());
Nicolas Zea 2011/05/22 00:10:32 Thinking about this further, I'm hesitant about th
James Hawkins 2011/05/23 21:25:45 Done.
+ args->SetBoolean("encryptAllData", encrypt_all);
+
// Load the parameters for the encryption tab.
args->SetBoolean("usePassphrase", service->IsUsingSecondaryPassphrase());
}
@@ -227,6 +234,12 @@ void SyncSetupFlow::OnUserConfigured(const SyncConfiguration& configuration) {
// Go to the "loading..." screen.
Advance(SyncSetupWizard::SETTING_UP);
+ if (configuration.encrypt_all) {
+ syncable::ModelTypeSet data_types;
+ service_->GetRegisteredDataTypes(&data_types);
+ service_->EncryptDataTypes(data_types);
+ }
+
// If we are activating the passphrase, we need to have one supplied.
DCHECK(service_->IsUsingSecondaryPassphrase() ||
!configuration.use_secondary_passphrase ||
« no previous file with comments | « chrome/browser/sync/sync_setup_flow.h ('k') | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698