| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 function $(id) { | 5 function $(id) { |
| 6 return document.getElementById(id); | 6 return document.getElementById(id); |
| 7 } | 7 } |
| 8 | 8 |
| 9 var ItemsList = options.ItemsList; | 9 var ItemsList = options.ItemsList; |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 */ | 102 */ |
| 103 initialize: function() { | 103 initialize: function() { |
| 104 // Set up the three buttons (load unpacked, pack and update). | 104 // Set up the three buttons (load unpacked, pack and update). |
| 105 $('load-unpacked').addEventListener('click', | 105 $('load-unpacked').addEventListener('click', |
| 106 this.handleLoadUnpackedItem_.bind(this)); | 106 this.handleLoadUnpackedItem_.bind(this)); |
| 107 $('pack-item').addEventListener('click', | 107 $('pack-item').addEventListener('click', |
| 108 this.handlePackItem_.bind(this)); | 108 this.handlePackItem_.bind(this)); |
| 109 $('update-items-now').addEventListener('click', | 109 $('update-items-now').addEventListener('click', |
| 110 this.handleUpdateItemNow_.bind(this)); | 110 this.handleUpdateItemNow_.bind(this)); |
| 111 | 111 |
| 112 var packItemOverlay = extensions.PackItemOverlay.getInstance(); |
| 113 packItemOverlay.initializePage(); |
| 112 }, | 114 }, |
| 113 | 115 |
| 114 /** Handles the Load Unpacked Extension button. | 116 /** Handles the Load Unpacked Extension button. |
| 115 * @param {Event} e Change event. | 117 * @param {Event} e Change event. |
| 116 * @private | 118 * @private |
| 117 */ | 119 */ |
| 118 handleLoadUnpackedItem_: function(e) { | 120 handleLoadUnpackedItem_: function(e) { |
| 119 chrome.developerPrivate.loadUnpacked(function(success) { | 121 chrome.developerPrivate.loadUnpacked(function(success) { |
| 120 loadItemsInfo(); | 122 loadItemsInfo(); |
| 121 }); | 123 }); |
| 122 }, | 124 }, |
| 123 | 125 |
| 124 /** Handles the Pack Extension button. | 126 /** Handles the Pack Extension button. |
| 125 * @param {Event} e Change event. | 127 * @param {Event} e Change event. |
| 126 * @private | 128 * @private |
| 127 */ | 129 */ |
| 128 handlePackItem_: function(e) { | 130 handlePackItem_: function(e) { |
| 129 //TODO (grv) : implement pack item. | 131 AppsDebugger.showOverlay($('packItemOverlay')); |
| 130 console.log('yet to be implemented...'); | |
| 131 }, | 132 }, |
| 132 | 133 |
| 133 /** | 134 /** |
| 134 * Handles the Update Extension Now Button. | 135 * Handles the Update Extension Now Button. |
| 135 * @param {Event} e Change event. | 136 * @param {Event} e Change event. |
| 136 * @private | 137 * @private |
| 137 */ | 138 */ |
| 138 handleUpdateItemNow_: function(e) { | 139 handleUpdateItemNow_: function(e) { |
| 139 chrome.developerPrivate.autoUpdate(function(response) { | 140 chrome.developerPrivate.autoUpdate(function(response) { |
| 140 }); | 141 }); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 158 AppsDebugger.showOverlay = function(node) { | 159 AppsDebugger.showOverlay = function(node) { |
| 159 var currentlyShowingOverlay = AppsDebugger.getCurrentOverlay(); | 160 var currentlyShowingOverlay = AppsDebugger.getCurrentOverlay(); |
| 160 if (currentlyShowingOverlay) | 161 if (currentlyShowingOverlay) |
| 161 currentlyShowingOverlay.classList.remove('showing'); | 162 currentlyShowingOverlay.classList.remove('showing'); |
| 162 if (node) | 163 if (node) |
| 163 node.classList.add('showing'); | 164 node.classList.add('showing'); |
| 164 overlay.hidden = !node; | 165 overlay.hidden = !node; |
| 165 uber.invokeMethodOnParent(node ? 'beginInterceptingEvents' : | 166 uber.invokeMethodOnParent(node ? 'beginInterceptingEvents' : |
| 166 'stopInterceptingEvents'); | 167 'stopInterceptingEvents'); |
| 167 }; | 168 }; |
| OLD | NEW |