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