Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * The different pages that can be shown at a time. | 6 * The different pages that can be shown at a time. |
| 7 * Note: This must remain in sync with the order in manager.html! | 7 * Note: This must remain in sync with the order in manager.html! |
| 8 * @enum {string} | 8 * @enum {string} |
| 9 */ | 9 */ |
| 10 var Page = { | 10 var Page = { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 created: function() { | 84 created: function() { |
| 85 this.readyPromiseResolver = new PromiseResolver(); | 85 this.readyPromiseResolver = new PromiseResolver(); |
| 86 }, | 86 }, |
| 87 | 87 |
| 88 ready: function() { | 88 ready: function() { |
| 89 /** @type {extensions.Sidebar} */ | 89 /** @type {extensions.Sidebar} */ |
| 90 this.sidebar = | 90 this.sidebar = |
| 91 /** @type {extensions.Sidebar} */(this.$$('extensions-sidebar')); | 91 /** @type {extensions.Sidebar} */(this.$$('extensions-sidebar')); |
| 92 this.listHelper_ = new ListHelper(this); | 92 this.listHelper_ = new ListHelper(this); |
| 93 this.sidebar.setListDelegate(this.listHelper_); | 93 this.sidebar.setListDelegate(this.listHelper_); |
| 94 this.$.toolbar.setSearchDelegate(new SearchHelper(this)); | |
| 95 this.readyPromiseResolver.resolve(); | 94 this.readyPromiseResolver.resolve(); |
| 96 }, | 95 }, |
| 97 | 96 |
| 98 /** | 97 /** |
| 98 * @param {!CustomEvent} event | |
| 99 * @private | |
| 100 */ | |
| 101 onFilterChanged_: function(event) { | |
| 102 this.filter = /** @type {string} */ (event.detail); | |
|
Devlin
2016/06/14 20:07:44
nit: I think no space between */ and (event.detail
Dan Beam
2016/06/14 22:11:20
i think i originally discouraged this, but clang f
| |
| 103 }, | |
| 104 | |
| 105 /** | |
| 99 * @param {chrome.developerPrivate.ExtensionType} type The type of item. | 106 * @param {chrome.developerPrivate.ExtensionType} type The type of item. |
| 100 * @return {string} The ID of the list that the item belongs in. | 107 * @return {string} The ID of the list that the item belongs in. |
| 101 * @private | 108 * @private |
| 102 */ | 109 */ |
| 103 getListId_: function(type) { | 110 getListId_: function(type) { |
| 104 var listId; | 111 var listId; |
| 105 var ExtensionType = chrome.developerPrivate.ExtensionType; | 112 var ExtensionType = chrome.developerPrivate.ExtensionType; |
| 106 switch (type) { | 113 switch (type) { |
| 107 case ExtensionType.HOSTED_APP: | 114 case ExtensionType.HOSTED_APP: |
| 108 case ExtensionType.LEGACY_PACKAGED_APP: | 115 case ExtensionType.LEGACY_PACKAGED_APP: |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 | 277 |
| 271 this.manager_.$['items-list'].set('items', assert(items)); | 278 this.manager_.$['items-list'].set('items', assert(items)); |
| 272 this.manager_.changePage(Page.ITEM_LIST); | 279 this.manager_.changePage(Page.ITEM_LIST); |
| 273 }, | 280 }, |
| 274 | 281 |
| 275 showKeyboardShortcuts: function() { | 282 showKeyboardShortcuts: function() { |
| 276 this.manager_.changePage(Page.KEYBOARD_SHORTCUTS); | 283 this.manager_.changePage(Page.KEYBOARD_SHORTCUTS); |
| 277 }, | 284 }, |
| 278 }; | 285 }; |
| 279 | 286 |
| 280 /** | |
| 281 * @param {extensions.Manager} manager | |
| 282 * @constructor | |
| 283 * @implements {SearchFieldDelegate} | |
| 284 */ | |
| 285 function SearchHelper(manager) { | |
| 286 this.manager_ = manager; | |
| 287 } | |
| 288 | |
| 289 SearchHelper.prototype = { | |
| 290 /** @override */ | |
| 291 onSearchTermSearch: function(searchTerm) { | |
| 292 this.manager_.filter = searchTerm; | |
| 293 }, | |
| 294 }; | |
| 295 | |
| 296 return {Manager: Manager}; | 287 return {Manager: Manager}; |
| 297 }); | 288 }); |
| OLD | NEW |