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', function() { | 5 cr.define('options', function() { |
6 /** @const */ var Page = cr.ui.pageManager.Page; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 index = i; | 206 index = i; |
207 break; | 207 break; |
208 } | 208 } |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 // Reveal the password in the UI. | 212 // Reveal the password in the UI. |
213 var item = this.savedPasswordsList_.getListItemByIndex(index); | 213 var item = this.savedPasswordsList_.getListItemByIndex(index); |
214 item.showPassword(password); | 214 item.showPassword(password); |
215 }, | 215 }, |
| 216 |
| 217 setManageAccountLinkVisibility_: function(visible) { |
| 218 $('manage-passwords-span').hidden = !visible; |
| 219 }, |
216 }; | 220 }; |
217 | 221 |
218 /** | 222 /** |
219 * Removes a saved password. | 223 * Removes a saved password. |
220 * @param {number} rowIndex indicating the row to remove. | 224 * @param {number} rowIndex indicating the row to remove. |
221 */ | 225 */ |
222 PasswordManager.removeSavedPassword = function(rowIndex) { | 226 PasswordManager.removeSavedPassword = function(rowIndex) { |
223 chrome.send('removeSavedPassword', [String(rowIndex)]); | 227 chrome.send('removeSavedPassword', [String(rowIndex)]); |
224 }; | 228 }; |
225 | 229 |
226 /** | 230 /** |
227 * Removes a password exception. | 231 * Removes a password exception. |
228 * @param {number} rowIndex indicating the row to remove. | 232 * @param {number} rowIndex indicating the row to remove. |
229 */ | 233 */ |
230 PasswordManager.removePasswordException = function(rowIndex) { | 234 PasswordManager.removePasswordException = function(rowIndex) { |
231 chrome.send('removePasswordException', [String(rowIndex)]); | 235 chrome.send('removePasswordException', [String(rowIndex)]); |
232 }; | 236 }; |
233 | 237 |
234 PasswordManager.requestShowPassword = function(index) { | 238 PasswordManager.requestShowPassword = function(index) { |
235 chrome.send('requestShowPassword', [index]); | 239 chrome.send('requestShowPassword', [index]); |
236 }; | 240 }; |
237 | 241 |
238 // Forward public APIs to private implementations on the singleton instance. | 242 // Forward public APIs to private implementations on the singleton instance. |
239 cr.makePublic(PasswordManager, [ | 243 cr.makePublic(PasswordManager, [ |
| 244 'setManageAccountLinkVisibility', |
240 'setSavedPasswordsList', | 245 'setSavedPasswordsList', |
241 'setPasswordExceptionsList', | 246 'setPasswordExceptionsList', |
242 'showPassword' | 247 'showPassword' |
243 ]); | 248 ]); |
244 | 249 |
245 // Export | 250 // Export |
246 return { | 251 return { |
247 PasswordManager: PasswordManager | 252 PasswordManager: PasswordManager |
248 }; | 253 }; |
249 | 254 |
250 }); | 255 }); |
OLD | NEW |