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

Unified Diff: chrome/browser/resources/apps_debugger/js/items.js

Issue 11794034: Adds functionality to pack an extension / app from the app. (Closed) Base URL: http://git.chromium.org/chromium/src.git@bacha_lo
Patch Set: Rebased and Addressed comments. Created 7 years, 10 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/apps_debugger/js/items.js
diff --git a/chrome/browser/resources/apps_debugger/js/items.js b/chrome/browser/resources/apps_debugger/js/items.js
index f1cb27e8a1ff93f1b0e158706a5c8e21b0d3487e..2465d0a219a666ba84ecccb741d6e9b7c03a59d5 100644
--- a/chrome/browser/resources/apps_debugger/js/items.js
+++ b/chrome/browser/resources/apps_debugger/js/items.js
@@ -117,14 +117,18 @@ AppsDevTool.prototype = {
// Set up the three buttons (load unpacked, pack and update).
$('load-unpacked').addEventListener('click',
this.handleLoadUnpackedItem_.bind(this));
+ $('pack-item').addEventListener('click',
+ this.handlePackItem_.bind(this));
$('update-items-now').addEventListener('click',
this.handleUpdateItemNow_.bind(this));
+ var packItemOverlay = appsDevtool.PackItemOverlay.getInstance();
+ packItemOverlay.initializePage();
+
},
- /**
- * Handles the Load Unpacked Extension button.
- * @param {!Event} e Change event.
+ /** Handles the Load Unpacked Extension button.
+ * @param {Event} e Change event.
* @private
*/
handleLoadUnpackedItem_: function(e) {
@@ -133,6 +137,14 @@ AppsDevTool.prototype = {
});
},
+ /** Handles the Pack Extension button.
+ * @param {Event} e Change event.
+ * @private
+ */
+ handlePackItem_: function(e) {
+ AppsDevTool.showOverlay($('packItemOverlay'));
+ },
+
/**
* Handles the Update Extension Now Button.
* @param {Event} e Change event.
@@ -148,13 +160,14 @@ AppsDevTool.prototype = {
* @return {Element} The overlay element.
*/
AppsDevTool.getCurrentOverlay = function() {
- return this.ownerDocument.querySelector('#overlay .page.showing');
+ return document.querySelector('#overlay .page.showing');
};
/**
- * Shows |node|. If there's another overlay showing, hide it.
+ * Sets the given overlay to show. This hides whatever overlay is currently
+ * showing, if any.
* @param {HTMLElement} node The overlay page to show. If falsey, all overlays
- * are hidden.
+ * are hidden.
*/
AppsDevTool.showOverlay = function(node) {
var currentlyShowingOverlay = AppsDevTool.getCurrentOverlay();

Powered by Google App Engine
This is Rietveld 408576698