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

Side by Side Diff: chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.js

Issue 2693373002: [MD Settings] Add title to show/hide password button. (Closed)
Patch Set: feedback Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 'password-edit-dialog' is the dialog that allows showing a 6 * @fileoverview 'password-edit-dialog' is the dialog that allows showing a
7 * saved password. 7 * saved password.
8 */ 8 */
9 9
10 (function() { 10 (function() {
(...skipping 28 matching lines...) Expand all
39 * Gets the password input's type. Should be 'text' when password is visible 39 * Gets the password input's type. Should be 'text' when password is visible
40 * and 'password' when it's not. 40 * and 'password' when it's not.
41 * @param {string} password 41 * @param {string} password
42 * @private 42 * @private
43 */ 43 */
44 getPasswordInputType_: function(password) { 44 getPasswordInputType_: function(password) {
45 return password ? 'text' : 'password'; 45 return password ? 'text' : 'password';
46 }, 46 },
47 47
48 /** 48 /**
49 * Gets the title text for the show/hide icon.
50 * @param {string} password
51 * @param {string} hide The i18n text to use for 'Hide'
52 * @param {string} show The i18n text to use for 'Show'
53 * @private
54 */
55 showPasswordTitle_: function(password, hide, show) {
56 return password ? hide : show;
57 },
58
59 /**
49 * Gets the text of the password. Will use the value of |password| unless it 60 * Gets the text of the password. Will use the value of |password| unless it
50 * cannot be shown, in which case it will be spaces. 61 * cannot be shown, in which case it will be spaces.
51 * @param {!chrome.passwordsPrivate.PasswordUiEntry} item 62 * @param {!chrome.passwordsPrivate.PasswordUiEntry} item
52 * @param {string} password 63 * @param {string} password
53 * @private 64 * @private
54 */ 65 */
55 getPassword_: function(item, password) { 66 getPassword_: function(item, password) {
56 if (password) 67 if (password)
57 return password; 68 return password;
58 return item ? ' '.repeat(item.numCharactersInPassword) : ''; 69 return item ? ' '.repeat(item.numCharactersInPassword) : '';
(...skipping 22 matching lines...) Expand all
81 /** 92 /**
82 * Handler for tapping the save button. 93 * Handler for tapping the save button.
83 * @private 94 * @private
84 */ 95 */
85 onSaveButtonTap_: function() { 96 onSaveButtonTap_: function() {
86 // TODO(hcarmona): what to save? 97 // TODO(hcarmona): what to save?
87 this.close(); 98 this.close();
88 }, 99 },
89 }); 100 });
90 })(); 101 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698