Chromium Code Reviews| 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 ///////////////////////////////////////////////////////////////////////////// |
| 11 // PasswordManager class: | 11 // PasswordManager class: |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Encapsulated handling of password and exceptions page. | 14 * Encapsulated handling of password and exceptions page. |
| 15 * @constructor | 15 * @constructor |
| 16 * @extends {cr.ui.pageManager.Page} | |
| 16 */ | 17 */ |
| 17 function PasswordManager() { | 18 function PasswordManager() { |
| 18 this.activeNavTab = null; | 19 this.activeNavTab = null; |
| 19 Page.call(this, 'passwords', | 20 Page.call(this, '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__: Page.prototype, | 28 __proto__: Page.prototype, |
| 28 | 29 |
| 29 /** | 30 /** |
| 30 * The saved passwords list. | 31 * The saved passwords list. |
| 31 * @type {DeletableItemList} | 32 * @type {options.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. |
| 38 * @type {DeletableItemList} | 39 * @type {options.DeletableItemList} |
| 39 * @private | 40 * @private |
| 40 */ | 41 */ |
| 41 passwordExceptionsList_: null, | 42 passwordExceptionsList_: null, |
| 42 | 43 |
| 43 /** | 44 /** |
| 44 * The timer id of the timer set on search query change events. | 45 * The timer id of the timer set on search query change events. |
| 45 * @type {number} | 46 * @type {number} |
| 46 * @private | 47 * @private |
| 47 */ | 48 */ |
| 48 queryDelayTimerId_: 0, | 49 queryDelayTimerId_: 0, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 this.lastQuery_ = filter; | 132 this.lastQuery_ = filter; |
| 132 // Searching for passwords has the side effect of requerying the | 133 // Searching for passwords has the side effect of requerying the |
| 133 // underlying password store. This is done intentionally, as on OS X and | 134 // underlying password store. This is done intentionally, as on OS X and |
| 134 // Linux they can change from outside and we won't be notified of it. | 135 // Linux they can change from outside and we won't be notified of it. |
| 135 chrome.send('updatePasswordLists'); | 136 chrome.send('updatePasswordLists'); |
| 136 } | 137 } |
| 137 }, | 138 }, |
| 138 | 139 |
| 139 /** | 140 /** |
| 140 * Updates the visibility of the list and empty list placeholder. | 141 * Updates the visibility of the list and empty list placeholder. |
| 141 * @param {!List} list The list to toggle visilibility for. | 142 * @param {!cu.ui.List} list The list to toggle visilibility for. |
|
Dan Beam
2014/09/06 02:22:38
uh oh
Vitaly Pavlenko
2014/09/06 22:54:09
Done.
| |
| 142 */ | 143 */ |
| 143 updateListVisibility_: function(list) { | 144 updateListVisibility_: function(list) { |
| 144 var empty = list.dataModel.length == 0; | 145 var empty = list.dataModel.length == 0; |
| 145 var listPlaceHolderID = list.id + '-empty-placeholder'; | 146 var listPlaceHolderID = list.id + '-empty-placeholder'; |
| 146 list.hidden = empty; | 147 list.hidden = empty; |
| 147 $(listPlaceHolderID).hidden = !empty; | 148 $(listPlaceHolderID).hidden = !empty; |
| 148 }, | 149 }, |
| 149 | 150 |
| 150 /** | 151 /** |
| 151 * Updates the data model for the saved passwords list with the values from | 152 * Updates the data model for the saved passwords list with the values from |
| (...skipping 89 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 |