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

Side by Side Diff: chrome/browser/ui/webui/options/sync_setup_handler.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/sync_setup_flow.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/google/google_util.h" 10 #include "chrome/browser/google/google_util.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (sync_sessions) 114 if (sync_sessions)
115 config->data_types.insert(syncable::SESSIONS); 115 config->data_types.insert(syncable::SESSIONS);
116 116
117 bool sync_apps; 117 bool sync_apps;
118 if (!result->GetBoolean("syncApps", &sync_apps)) 118 if (!result->GetBoolean("syncApps", &sync_apps))
119 return false; 119 return false;
120 if (sync_apps) 120 if (sync_apps)
121 config->data_types.insert(syncable::APPS); 121 config->data_types.insert(syncable::APPS);
122 122
123 // Encryption settings. 123 // Encryption settings.
124 if (!result->GetBoolean("encryptAllData", &config->encrypt_all))
125 return false;
126
127 // Passphrase settings.
124 if (!result->GetBoolean("usePassphrase", &config->use_secondary_passphrase)) 128 if (!result->GetBoolean("usePassphrase", &config->use_secondary_passphrase))
125 return false; 129 return false;
126 if (config->use_secondary_passphrase && 130 if (config->use_secondary_passphrase &&
127 !result->GetString("passphrase", &config->secondary_passphrase)) 131 !result->GetString("passphrase", &config->secondary_passphrase))
128 return false; 132 return false;
129 133
130 return true; 134 return true;
131 } 135 }
132 136
133 bool GetPassphrase(const std::string& json, std::string* passphrase) { 137 bool GetPassphrase(const std::string& json, std::string* passphrase) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 { "incorrectPassphrase", IDS_SYNC_INCORRECT_PASSPHRASE }, 241 { "incorrectPassphrase", IDS_SYNC_INCORRECT_PASSPHRASE },
238 { "passphraseRecover", IDS_SYNC_PASSPHRASE_RECOVER }, 242 { "passphraseRecover", IDS_SYNC_PASSPHRASE_RECOVER },
239 { "passphraseWarning", IDS_SYNC_PASSPHRASE_WARNING }, 243 { "passphraseWarning", IDS_SYNC_PASSPHRASE_WARNING },
240 { "cancelWarningHeader", IDS_SYNC_PASSPHRASE_CANCEL_WARNING_HEADER }, 244 { "cancelWarningHeader", IDS_SYNC_PASSPHRASE_CANCEL_WARNING_HEADER },
241 { "cancelWarning", IDS_SYNC_PASSPHRASE_CANCEL_WARNING }, 245 { "cancelWarning", IDS_SYNC_PASSPHRASE_CANCEL_WARNING },
242 { "yes", IDS_SYNC_PASSPHRASE_CANCEL_YES }, 246 { "yes", IDS_SYNC_PASSPHRASE_CANCEL_YES },
243 { "no", IDS_SYNC_PASSPHRASE_CANCEL_NO }, 247 { "no", IDS_SYNC_PASSPHRASE_CANCEL_NO },
244 { "sectionExplicitMessagePrefix", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX }, 248 { "sectionExplicitMessagePrefix", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX },
245 { "sectionExplicitMessagePostfix", 249 { "sectionExplicitMessagePostfix",
246 IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX }, 250 IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX },
251 { "encryptedDataTypesTitle", IDS_SYNC_ENCRYPTION_DATA_TYPES_TITLE },
252 { "encryptSensitiveOption", IDS_SYNC_ENCRYPT_SENSITIVE_DATA },
253 { "encryptAllOption", IDS_SYNC_ENCRYPT_ALL_DATA },
247 }; 254 };
248 255
249 RegisterStrings(localized_strings, resources, arraysize(resources)); 256 RegisterStrings(localized_strings, resources, arraysize(resources));
250 } 257 }
251 258
252 void SyncSetupHandler::Initialize() { 259 void SyncSetupHandler::Initialize() {
253 } 260 }
254 261
255 void SyncSetupHandler::RegisterMessages() { 262 void SyncSetupHandler::RegisterMessages() {
256 web_ui_->RegisterMessageCallback("didShowPage", 263 web_ui_->RegisterMessageCallback("didShowPage",
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 397 }
391 398
392 DCHECK(flow_); 399 DCHECK(flow_);
393 flow_->OnPassphraseEntry(passphrase); 400 flow_->OnPassphraseEntry(passphrase);
394 } 401 }
395 402
396 void SyncSetupHandler::HandlePassphraseCancel(const ListValue* args) { 403 void SyncSetupHandler::HandlePassphraseCancel(const ListValue* args) {
397 DCHECK(flow_); 404 DCHECK(flow_);
398 flow_->OnPassphraseCancel(); 405 flow_->OnPassphraseCancel();
399 } 406 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_setup_flow.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698