| 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 cr.define('apps_dev_tool', function() { | 5 cr.define('apps_dev_tool', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * AppsDevTool constructor. | 9 * AppsDevTool constructor. |
| 10 * @constructor | 10 * @constructor |
| 11 * @extends {HTMLDivElement} | 11 * @extends {HTMLDivElement} |
| 12 */ | 12 */ |
| 13 function AppsDevTool() {} | 13 function AppsDevTool() {} |
| 14 | 14 |
| 15 AppsDevTool.prototype = { | 15 AppsDevTool.prototype = { |
| 16 __proto__: HTMLDivElement.prototype, | 16 __proto__: HTMLDivElement.prototype, |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * Perform initial setup. | 19 * Perform initial setup. |
| 20 */ | 20 */ |
| 21 initialize: function() { | 21 initialize: function() { |
| 22 // Set up the three buttons (load unpacked, pack and update). | 22 // Set up the three buttons (load unpacked, pack and update). |
| 23 $('load-unpacked').addEventListener('click', | 23 $('load-unpacked').addEventListener('click', |
| 24 this.handleLoadUnpackedItem_.bind(this)); | 24 this.handleLoadUnpackedItem_.bind(this)); |
| 25 $('pack-item').addEventListener('click', | 25 $('pack-item').addEventListener('click', |
| 26 this.handlePackItem_.bind(this)); | 26 this.handlePackItem_.bind(this)); |
| 27 $('update-items-now').addEventListener('click', | 27 $('update-items-now').addEventListener('click', |
| 28 this.handleUpdateItemNow_.bind(this)); | 28 this.handleUpdateItemNow_.bind(this)); |
| 29 $('permissions-close').addEventListener('click', function() { | |
| 30 AppsDevTool.showOverlay(null); | |
| 31 }); | |
| 32 var packItemOverlay = | 29 var packItemOverlay = |
| 33 apps_dev_tool.PackItemOverlay.getInstance().initializePage(); | 30 apps_dev_tool.PackItemOverlay.getInstance().initializePage(); |
| 34 }, | 31 }, |
| 35 | 32 |
| 36 /** | 33 /** |
| 37 * Handles the Load Unpacked Extension button. | 34 * Handles the Load Unpacked Extension button. |
| 38 * @param {!Event} e Click event. | 35 * @param {!Event} e Click event. |
| 39 * @private | 36 * @private |
| 40 */ | 37 */ |
| 41 handleLoadUnpackedItem_: function(e) { | 38 handleLoadUnpackedItem_: function(e) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 chrome.developerPrivate.getStrings(function(strings) { | 90 chrome.developerPrivate.getStrings(function(strings) { |
| 94 loadTimeData.data = strings; | 91 loadTimeData.data = strings; |
| 95 i18nTemplate.process(document, loadTimeData); | 92 i18nTemplate.process(document, loadTimeData); |
| 96 }); | 93 }); |
| 97 }; | 94 }; |
| 98 | 95 |
| 99 return { | 96 return { |
| 100 AppsDevTool: AppsDevTool, | 97 AppsDevTool: AppsDevTool, |
| 101 }; | 98 }; |
| 102 }); | 99 }); |
| OLD | NEW |