OLD | NEW |
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (button) | 169 if (button) |
170 button.textContent = loadTimeData.getString('passwordShowButton'); | 170 button.textContent = loadTimeData.getString('passwordShowButton'); |
171 }, | 171 }, |
172 | 172 |
173 /** | 173 /** |
174 * Get the original index of this item in the data model. | 174 * Get the original index of this item in the data model. |
175 * @return {number} The index. | 175 * @return {number} The index. |
176 * @private | 176 * @private |
177 */ | 177 */ |
178 getOriginalIndex_: function() { | 178 getOriginalIndex_: function() { |
179 var index = this.dataItem[INDEX_DATA_INDEX]; | 179 var index = this.dataItem[ORIGINAL_DATA_INDEX]; |
180 return index ? index : this.dataModel.indexOf(this.dataItem); | 180 return index ? index : this.dataModel.indexOf(this.dataItem); |
181 }, | 181 }, |
182 | 182 |
183 /** | 183 /** |
184 * On-click event handler. Swaps the type of the input field from password | 184 * On-click event handler. Swaps the type of the input field from password |
185 * to text and back. | 185 * to text and back. |
186 * @private | 186 * @private |
187 */ | 187 */ |
188 onClick_: function(event) { | 188 onClick_: function(event) { |
189 if (this.passwordField.type == 'password') { | 189 if (this.passwordField.type == 'password') { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 }, | 228 }, |
229 | 229 |
230 /** | 230 /** |
231 * Get and set the federation for the entry. | 231 * Get and set the federation for the entry. |
232 * @type {string} | 232 * @type {string} |
233 */ | 233 */ |
234 get federation() { | 234 get federation() { |
235 return this.dataItem[FEDERATION_DATA_INDEX]; | 235 return this.dataItem[FEDERATION_DATA_INDEX]; |
236 }, | 236 }, |
237 set federation(federation) { | 237 set federation(federation) { |
238 this.dataItem[FEDERATION_DATA_INDEX] = password; | 238 this.dataItem[FEDERATION_DATA_INDEX] = federation; |
239 }, | 239 }, |
240 }; | 240 }; |
241 | 241 |
242 /** | 242 /** |
243 * Creates a new PasswordExceptions list item. | 243 * Creates a new PasswordExceptions list item. |
244 * @param {Array} entry A pair of the form [url, username]. | 244 * @param {Array} entry A pair of the form [url, username]. |
245 * @constructor | 245 * @constructor |
246 * @extends {options.DeletableItem} | 246 * @extends {options.DeletableItem} |
247 */ | 247 */ |
248 function PasswordExceptionsListItem(entry) { | 248 function PasswordExceptionsListItem(entry) { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 }, | 401 }, |
402 }; | 402 }; |
403 | 403 |
404 return { | 404 return { |
405 PasswordListItem: PasswordListItem, | 405 PasswordListItem: PasswordListItem, |
406 PasswordExceptionsListItem: PasswordExceptionsListItem, | 406 PasswordExceptionsListItem: PasswordExceptionsListItem, |
407 PasswordsList: PasswordsList, | 407 PasswordsList: PasswordsList, |
408 PasswordExceptionsList: PasswordExceptionsList, | 408 PasswordExceptionsList: PasswordExceptionsList, |
409 }; | 409 }; |
410 }); | 410 }); |
OLD | NEW |