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

Side by Side Diff: chrome/browser/resources/options/password_manager_list.js

Issue 107023009: Disable ability to show passwords when running in Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change to use localized strings instead Created 7 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options.passwordManager', function() { 5 cr.define('options.passwordManager', function() {
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel;
7 /** @const */ var DeletableItemList = options.DeletableItemList; 7 /** @const */ var DeletableItemList = options.DeletableItemList;
8 /** @const */ var DeletableItem = options.DeletableItem; 8 /** @const */ var DeletableItem = options.DeletableItem;
9 /** @const */ var List = cr.ui.List; 9 /** @const */ var List = cr.ui.List;
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 'profile.password_manager_allow_show_passwords', 266 'profile.password_manager_allow_show_passwords',
267 this.onPreferenceChanged_.bind(this)); 267 this.onPreferenceChanged_.bind(this));
268 }, 268 },
269 269
270 /** 270 /**
271 * Listener for changes on the preference. 271 * Listener for changes on the preference.
272 * @param {Event} event The preference update event. 272 * @param {Event} event The preference update event.
273 * @private 273 * @private
274 */ 274 */
275 onPreferenceChanged_: function(event) { 275 onPreferenceChanged_: function(event) {
276 this.showPasswords_ = event.value.value; 276 this.showPasswords_ = event.value.value;
Patrick Dubroy 2013/12/13 16:54:01 I think you want to change this to: if (this.sh
277 this.redraw(); 277 this.redraw();
278 }, 278 },
279 279
280 /** @override */ 280 /** @override */
281 createItem: function(entry) { 281 createItem: function(entry) {
282 return new PasswordListItem(this.dataModel, entry, this.showPasswords_); 282 var showPasswords = this.showPasswords_;
283
284 if (loadTimeData.getBoolean('disableShowPasswords'))
Patrick Dubroy 2013/12/13 14:19:10 Can't you just initialize this.showPasswords_ with
285 showPasswords = false;
286
287 return new PasswordListItem(this.dataModel, entry, showPasswords);
283 }, 288 },
284 289
285 /** @override */ 290 /** @override */
286 deleteItemAtIndex: function(index) { 291 deleteItemAtIndex: function(index) {
287 var item = this.dataModel.item(index); 292 var item = this.dataModel.item(index);
288 if (item && item.length > 3) { 293 if (item && item.length > 3) {
289 // The fourth element, if present, is the original index to delete. 294 // The fourth element, if present, is the original index to delete.
290 index = item[3]; 295 index = item[3];
291 } 296 }
292 PasswordManager.removeSavedPassword(index); 297 PasswordManager.removeSavedPassword(index);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 }, 333 },
329 }; 334 };
330 335
331 return { 336 return {
332 PasswordListItem: PasswordListItem, 337 PasswordListItem: PasswordListItem,
333 PasswordExceptionsListItem: PasswordExceptionsListItem, 338 PasswordExceptionsListItem: PasswordExceptionsListItem,
334 PasswordsList: PasswordsList, 339 PasswordsList: PasswordsList,
335 PasswordExceptionsList: PasswordExceptionsList, 340 PasswordExceptionsList: PasswordExceptionsList,
336 }; 341 };
337 }); 342 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698