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

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

Issue 2960293002: MD Extensions: Convert classes to use ES6 class syntax. (Closed)
Patch Set: Created 3 years, 5 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 cr.define('extensions', function() { 5 cr.define('extensions', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Compares two extensions to determine which should come first in the list. 9 * Compares two extensions to determine which should come first in the list.
10 * @param {chrome.developerPrivate.ExtensionInfo} a 10 * @param {chrome.developerPrivate.ExtensionInfo} a
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // extra work for the data-bound error page. 415 // extra work for the data-bound error page.
416 this.changePage({page: Page.LIST}); 416 this.changePage({page: Page.LIST});
417 }, 417 },
418 418
419 /** @private */ 419 /** @private */
420 onPackTap_: function() { 420 onPackTap_: function() {
421 this.$['pack-dialog'].show(); 421 this.$['pack-dialog'].show();
422 } 422 }
423 }); 423 });
424 424
425 /** 425 /** @implements {extensions.SidebarListDelegate} */
426 * @param {extensions.Manager} manager 426 class ListHelper {
427 * @constructor 427 /** @param {extensions.Manager} manager */
428 * @implements {extensions.SidebarListDelegate} 428 constructor(manager) {
429 */ 429 this.manager_ = manager;
430 function ListHelper(manager) { 430 }
431 this.manager_ = manager;
432 }
433 431
434 ListHelper.prototype = {
435 /** @override */ 432 /** @override */
436 showType: function(type) { 433 showType(type) {
437 var items; 434 var items;
438 switch (type) { 435 switch (type) {
439 case extensions.ShowingType.EXTENSIONS: 436 case extensions.ShowingType.EXTENSIONS:
440 items = this.manager_.extensions; 437 items = this.manager_.extensions;
441 break; 438 break;
442 case extensions.ShowingType.APPS: 439 case extensions.ShowingType.APPS:
443 items = this.manager_.apps; 440 items = this.manager_.apps;
444 break; 441 break;
445 } 442 }
446 443
447 this.manager_.$ /* hack */['items-list'].set('items', assert(items)); 444 this.manager_.$ /* hack */['items-list'].set('items', assert(items));
448 this.manager_.changePage({page: Page.LIST}); 445 this.manager_.changePage({page: Page.LIST});
449 }, 446 }
450 447
451 /** @override */ 448 /** @override */
452 showKeyboardShortcuts: function() { 449 showKeyboardShortcuts() {
453 this.manager_.changePage({page: Page.SHORTCUTS}); 450 this.manager_.changePage({page: Page.SHORTCUTS});
454 }, 451 }
455 }; 452 }
456 453
457 return {Manager: Manager}; 454 return {Manager: Manager};
458 }); 455 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698