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

Unified Diff: chrome/browser/resources/md_extensions/sidebar.js

Issue 1913353002: [MD Extensions] Add a details subpage, move to one list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: latest master Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_extensions/sidebar.js
diff --git a/chrome/browser/resources/md_extensions/sidebar.js b/chrome/browser/resources/md_extensions/sidebar.js
index 622c5ec3ada68aacad544a66042d0a361752bf01..0bb5f3d7c444656161f6fd2a5ebf560e93cb4f5c 100644
--- a/chrome/browser/resources/md_extensions/sidebar.js
+++ b/chrome/browser/resources/md_extensions/sidebar.js
@@ -2,7 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+cr.exportPath('extensions');
+
+// Declare this here to make closure compiler happy, and us sad.
+/** @enum {number} */
+extensions.ShowingType = {
+ EXTENSIONS: 0,
+ APPS: 1,
+};
+
cr.define('extensions', function() {
+
/** @interface */
var SidebarDelegate = function() {};
@@ -24,17 +34,14 @@ cr.define('extensions', function() {
};
/** @interface */
- var SidebarScrollDelegate = function() {};
+ var SidebarListDelegate = function() {};
- SidebarScrollDelegate.prototype = {
- /** Scrolls to the extensions section. */
- scrollToExtensions: assertNotReached,
-
- /** Scrolls to the apps section. */
- scrollToApps: assertNotReached,
-
- /** Scrolls to the websites section. */
- scrollToWebsites: assertNotReached,
+ SidebarListDelegate.prototype = {
+ /**
+ * Shows the given type of item.
+ * @param {extensions.ShowingType} type
+ */
+ showType: assertNotReached,
};
var Sidebar = Polymer({
@@ -45,26 +52,9 @@ cr.define('extensions', function() {
type: Boolean,
value: false,
},
-
- hideExtensionsButton: {
- type: Boolean,
- value: false,
- },
-
- hideAppsButton: {
- type: Boolean,
- value: false,
- },
-
- hideWebsitesButton: {
- type: Boolean,
- value: false,
- },
},
- behaviors: [
- I18nBehavior,
- ],
+ behaviors: [I18nBehavior],
/** @param {extensions.SidebarDelegate} delegate */
setDelegate: function(delegate) {
@@ -72,25 +62,20 @@ cr.define('extensions', function() {
this.delegate_ = delegate;
},
- /** @param {extensions.SidebarScrollDelegate} scrollDelegate */
- setScrollDelegate: function(scrollDelegate) {
- /** @private {extensions.SidebarScrollDelegate} */
- this.scrollDelegate_ = scrollDelegate;
+ /** @param {extensions.SidebarListDelegate} listDelegate */
+ setListDelegate: function(listDelegate) {
+ /** @private {extensions.SidebarListDelegate} */
+ this.listDelegate_ = listDelegate;
},
/** @private */
onExtensionsTap_: function() {
- this.scrollDelegate_.scrollToExtensions();
+ this.listDelegate_.showType(extensions.ShowingType.EXTENSIONS);
},
/** @private */
onAppsTap_: function() {
- this.scrollDelegate_.scrollToApps();
- },
-
- /** @private */
- onWebsitesTap_: function() {
- this.scrollDelegate_.scrollToWebsites();
+ this.listDelegate_.showType(extensions.ShowingType.APPS);
},
/** @private */
@@ -118,7 +103,7 @@ cr.define('extensions', function() {
return {
Sidebar: Sidebar,
SidebarDelegate: SidebarDelegate,
- SidebarScrollDelegate: SidebarScrollDelegate,
+ SidebarListDelegate: SidebarListDelegate,
};
});
« no previous file with comments | « chrome/browser/resources/md_extensions/sidebar.html ('k') | chrome/browser/ui/webui/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698