| 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 OptionsPage = options.OptionsPage; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
| 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
| 7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 9 |
| 9 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
| 10 // PasswordManager class: | 11 // PasswordManager class: |
| 11 | 12 |
| 12 /** | 13 /** |
| 13 * Encapsulated handling of password and exceptions page. | 14 * Encapsulated handling of password and exceptions page. |
| 14 * @constructor | 15 * @constructor |
| 15 */ | 16 */ |
| 16 function PasswordManager() { | 17 function PasswordManager() { |
| 17 this.activeNavTab = null; | 18 this.activeNavTab = null; |
| 18 OptionsPage.call(this, | 19 Page.call(this, 'passwords', |
| 19 'passwords', | 20 loadTimeData.getString('passwordsPageTabTitle'), |
| 20 loadTimeData.getString('passwordsPageTabTitle'), | 21 'password-manager'); |
| 21 'password-manager'); | |
| 22 } | 22 } |
| 23 | 23 |
| 24 cr.addSingletonGetter(PasswordManager); | 24 cr.addSingletonGetter(PasswordManager); |
| 25 | 25 |
| 26 PasswordManager.prototype = { | 26 PasswordManager.prototype = { |
| 27 __proto__: OptionsPage.prototype, | 27 __proto__: Page.prototype, |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * The saved passwords list. | 30 * The saved passwords list. |
| 31 * @type {DeletableItemList} | 31 * @type {DeletableItemList} |
| 32 * @private | 32 * @private |
| 33 */ | 33 */ |
| 34 savedPasswordsList_: null, | 34 savedPasswordsList_: null, |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * The password exceptions list. | 37 * The password exceptions list. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 /** | 50 /** |
| 51 * The most recent search query, or null if the query is empty. | 51 * The most recent search query, or null if the query is empty. |
| 52 * @type {?string} | 52 * @type {?string} |
| 53 * @private | 53 * @private |
| 54 */ | 54 */ |
| 55 lastQuery_: null, | 55 lastQuery_: null, |
| 56 | 56 |
| 57 /** @override */ | 57 /** @override */ |
| 58 initializePage: function() { | 58 initializePage: function() { |
| 59 OptionsPage.prototype.initializePage.call(this); | 59 Page.prototype.initializePage.call(this); |
| 60 | 60 |
| 61 $('password-manager-confirm').onclick = function() { | 61 $('password-manager-confirm').onclick = function() { |
| 62 OptionsPage.closeOverlay(); | 62 PageManager.closeOverlay(); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 $('password-search-box').addEventListener('search', | 65 $('password-search-box').addEventListener('search', |
| 66 this.handleSearchQueryChange_.bind(this)); | 66 this.handleSearchQueryChange_.bind(this)); |
| 67 | 67 |
| 68 this.createSavedPasswordsList_(); | 68 this.createSavedPasswordsList_(); |
| 69 this.createPasswordExceptionsList_(); | 69 this.createPasswordExceptionsList_(); |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 /** @override */ | 72 /** @override */ |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return instance[name + '_'].apply(instance, arguments); | 241 return instance[name + '_'].apply(instance, arguments); |
| 242 }; | 242 }; |
| 243 }); | 243 }); |
| 244 | 244 |
| 245 // Export | 245 // Export |
| 246 return { | 246 return { |
| 247 PasswordManager: PasswordManager | 247 PasswordManager: PasswordManager |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 }); | 250 }); |
| OLD | NEW |