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 || |