Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: chrome/browser/resources/md_extensions/manager.js

Issue 2060023002: WebUI: cr-search-field: Remove delegation pattern, use simple event instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_box0
Patch Set: Addressing md_downloads/ comments. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {!Event} event
Devlin 2016/06/14 19:19:32 !CustomEvent
dpapad 2016/06/14 19:29:48 Already done at patch 6.
99 * @private
100 */
101 onFilterChanged_: function(event) {
102 this.filter = event.detail;
Devlin 2016/06/14 19:19:32 Also wrong before this, but I think this should be
dpapad 2016/06/14 19:29:48 My understanding is that direct assignment and usa
Devlin 2016/06/14 20:07:44 Ah, I didn't realize that it was only for deep pro
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_extensions/manager.html ('k') | chrome/browser/resources/md_extensions/toolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698