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

Unified Diff: chrome/browser/resources/options/sync_setup_overlay.js

Issue 7056059: Clear passphrase/password input elements before loading the sync setup ui (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added comment to resetPage_. Created 9 years, 6 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/resources/options/sync_setup_overlay.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/sync_setup_overlay.js
diff --git a/chrome/browser/resources/options/sync_setup_overlay.js b/chrome/browser/resources/options/sync_setup_overlay.js
index b94623a80b4d10125b36240a1027d05eb91726eb..fb439c46bb415b8a1fa882a462fb13c4dbce2e57 100644
--- a/chrome/browser/resources/options/sync_setup_overlay.js
+++ b/chrome/browser/resources/options/sync_setup_overlay.js
@@ -372,10 +372,9 @@ cr.define('options', function() {
self.setCheckboxesToKeepEverythingSynced_(syncAll);
};
+ this.resetPage_('sync-setup-configure');
$('sync-setup-configure').hidden = false;
- this.clearPassphraseInputs_();
-
if (args) {
if (!args['encryptionEnabled'])
$('customize-sync-encryption').hidden = true;
@@ -394,19 +393,9 @@ cr.define('options', function() {
}
},
- /**
- * Clears the value of the custom passphrase inputs.
- * @private
- */
- clearPassphraseInputs_: function() {
- $('custom-passphrase').value = '';
- $('confirm-passphrase').value = '';
- },
-
showSyncEverythingPage_: function() {
$('confirm-sync-preferences').hidden = false;
$('customize-sync-preferences').hidden = true;
- this.clearPassphraseInputs_();
// Reset the selection to 'Sync everything'.
$('sync-select-datatypes').selectedIndex = 0;
@@ -446,8 +435,7 @@ cr.define('options', function() {
if (args["passphrase_setting_rejected"])
$('incorrect-passphrase').hidden = false;
- $('sync-passphrase-warning').innerHTML =
- localStrings.getString('passphraseRecover');
+ $('sync-passphrase-warning').hidden = false;
$('passphrase').focus();
},
@@ -544,6 +532,14 @@ cr.define('options', function() {
$('captcha-wrapper').style.backgroundImage = url(args.captchaUrl);
},
+ /**
+ * Reset the state of all descendant elements of a root element to their
+ * initial state.
+ * The initial state is specified by adding a class to the descendant
+ * element in sync_setup_overlay.html.
+ * @param pageElementId The root page element id.
+ * @private
+ */
resetPage_: function(pageElementId) {
var page = $(pageElementId);
var forEach = function(arr, fn) {
@@ -563,6 +559,8 @@ cr.define('options', function() {
function(elt) { elt.disabled = false; });
forEach(page.getElementsByClassName('reset-visibility-hidden'),
function(elt) { elt.style.visibility = 'hidden'; });
+ forEach(page.getElementsByClassName('reset-value'),
+ function(elt) { elt.value = ''; });
},
showGaiaLogin_: function(args) {
« no previous file with comments | « chrome/browser/resources/options/sync_setup_overlay.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698