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

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: Review fix. 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..34d2cae1365c1911a621ec625a278c486e90aebe 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sync/sync_setup_flow.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
@@ -15,10 +16,12 @@
#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"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -141,6 +144,15 @@ void SyncSetupFlow::GetArgsForConfigure(ProfileSyncService* service,
service->profile()->GetPrefs()->GetBoolean(prefs::kSyncTypedUrls));
args->SetBoolean("syncApps",
service->profile()->GetPrefs()->GetBoolean(prefs::kSyncApps));
+ args->SetBoolean("encryptionEnabled",
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableSyncEncryption));
+
+ syncable::ModelTypeSet encrypted_types;
+ service->GetEncryptedDataTypes(&encrypted_types);
+ bool encrypt_all =
+ encrypted_types.upper_bound(syncable::PASSWORDS) != encrypted_types.end();
+ args->SetBoolean("encryptAllData", encrypt_all);
// Load the parameters for the encryption tab.
args->SetBoolean("usePassphrase", service->IsUsingSecondaryPassphrase());
@@ -227,6 +239,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