| OLD | NEW |
| 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
| 7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
| 10 // PasswordManager class: | 10 // PasswordManager class: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 var listPlaceHolderID = list.id + '-empty-placeholder'; | 90 var listPlaceHolderID = list.id + '-empty-placeholder'; |
| 91 list.hidden = empty; | 91 list.hidden = empty; |
| 92 $(listPlaceHolderID).hidden = !empty; | 92 $(listPlaceHolderID).hidden = !empty; |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Updates the data model for the saved passwords list with the values from | 96 * Updates the data model for the saved passwords list with the values from |
| 97 * |entries|. | 97 * |entries|. |
| 98 * @param {Array} entries The list of saved password data. | 98 * @param {Array} entries The list of saved password data. |
| 99 */ | 99 */ |
| 100 setSavedPasswordsList_: function(entries) { | 100 setSavedPasswordsList_: function(entries, showPasswords) { |
| 101 this.savedPasswordsList_.showPasswords = showPasswords; |
| 101 this.savedPasswordsList_.dataModel = new ArrayDataModel(entries); | 102 this.savedPasswordsList_.dataModel = new ArrayDataModel(entries); |
| 102 this.updateListVisibility_(this.savedPasswordsList_); | 103 this.updateListVisibility_(this.savedPasswordsList_); |
| 103 }, | 104 }, |
| 104 | 105 |
| 105 /** | 106 /** |
| 106 * Updates the data model for the password exceptions list with the values | 107 * Updates the data model for the password exceptions list with the values |
| 107 * from |entries|. | 108 * from |entries|. |
| 108 * @param {Array} entries The list of password exception data. | 109 * @param {Array} entries The list of password exception data. |
| 109 */ | 110 */ |
| 110 setPasswordExceptionsList_: function(entries) { | 111 setPasswordExceptionsList_: function(entries) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 /** | 141 /** |
| 141 * Call to remove all saved passwords. | 142 * Call to remove all saved passwords. |
| 142 * @param tab contentType of the tab currently on. | 143 * @param tab contentType of the tab currently on. |
| 143 */ | 144 */ |
| 144 PasswordManager.removeAllPasswordExceptions = function() { | 145 PasswordManager.removeAllPasswordExceptions = function() { |
| 145 chrome.send('removeAllPasswordExceptions'); | 146 chrome.send('removeAllPasswordExceptions'); |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 PasswordManager.setSavedPasswordsList = function(entries) { | 149 PasswordManager.setSavedPasswordsList = function(entries, showPasswords) { |
| 149 PasswordManager.getInstance().setSavedPasswordsList_(entries); | 150 PasswordManager.getInstance().setSavedPasswordsList_(entries, |
| 151 showPasswords); |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 PasswordManager.setPasswordExceptionsList = function(entries) { | 154 PasswordManager.setPasswordExceptionsList = function(entries) { |
| 153 PasswordManager.getInstance().setPasswordExceptionsList_(entries); | 155 PasswordManager.getInstance().setPasswordExceptionsList_(entries); |
| 154 }; | 156 }; |
| 155 | 157 |
| 156 // Export | 158 // Export |
| 157 return { | 159 return { |
| 158 PasswordManager: PasswordManager | 160 PasswordManager: PasswordManager |
| 159 }; | 161 }; |
| 160 | 162 |
| 161 }); | 163 }); |
| OLD | NEW |