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 <include src="../uber/uber_utils.js"></include> | 5 <include src="../uber/uber_utils.js"></include> |
6 <include src="extension_commands_overlay.js"></include> | 6 <include src="extension_commands_overlay.js"></include> |
7 <include src="extension_focus_manager.js"></include> | 7 <include src="extension_focus_manager.js"></include> |
8 <include src="extension_list.js"></include> | 8 <include src="extension_list.js"></include> |
9 <include src="pack_extension_overlay.js"></include> | 9 <include src="pack_extension_overlay.js"></include> |
10 <include src="extension_error_overlay.js"></include> | 10 <include src="extension_error_overlay.js"></include> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 /** | 77 /** |
78 * ExtensionSettings class | 78 * ExtensionSettings class |
79 * @class | 79 * @class |
80 */ | 80 */ |
81 function ExtensionSettings() {} | 81 function ExtensionSettings() {} |
82 | 82 |
83 cr.addSingletonGetter(ExtensionSettings); | 83 cr.addSingletonGetter(ExtensionSettings); |
84 | 84 |
85 ExtensionSettings.prototype = { | 85 ExtensionSettings.prototype = { |
86 __proto__: HTMLDivElement.prototype, | 86 __proto__: HTMLDivElement.prototype, |
87 | 87 |
Dan Beam
2014/04/18 23:08:33
nit:
/**
* Whether the App Developer Tools promo
Devlin
2014/04/18 23:41:02
Done.
| |
88 /** | 88 /** |
89 * Perform initial setup. | 89 * Perform initial setup. |
90 */ | 90 */ |
91 initialize: function() { | 91 initialize: function() { |
92 uber.onContentFrameLoaded(); | 92 uber.onContentFrameLoaded(); |
93 cr.ui.FocusOutlineManager.forDocument(document); | 93 cr.ui.FocusOutlineManager.forDocument(document); |
94 measureCheckboxStrings(); | 94 measureCheckboxStrings(); |
95 | 95 |
96 // Set the title. | 96 // Set the title. |
97 var title = loadTimeData.getString('extensionSettings'); | 97 var title = loadTimeData.getString('extensionSettings'); |
98 uber.invokeMethodOnParent('setTitle', {title: title}); | 98 uber.invokeMethodOnParent('setTitle', {title: title}); |
99 | 99 |
100 // This will request the data to show on the page and will get a response | 100 // This will request the data to show on the page and will get a response |
101 // back in returnExtensionsData. | 101 // back in returnExtensionsData. |
102 chrome.send('extensionSettingsRequestExtensionsData'); | 102 chrome.send('extensionSettingsRequestExtensionsData'); |
103 | 103 |
104 $('toggle-dev-on').addEventListener('change', | 104 $('toggle-dev-on').addEventListener('change', |
105 this.handleToggleDevMode_.bind(this)); | 105 this.handleToggleDevMode_.bind(this)); |
106 $('dev-controls').addEventListener('webkitTransitionEnd', | 106 $('dev-controls').addEventListener('webkitTransitionEnd', |
107 this.handleDevControlsTransitionEnd_.bind(this)); | 107 this.handleDevControlsTransitionEnd_.bind(this)); |
108 | 108 |
109 // Set up the three dev mode buttons (load unpacked, pack and update). | 109 // Set up the three dev mode buttons (load unpacked, pack and update). |
110 $('load-unpacked').addEventListener('click', | 110 $('load-unpacked').addEventListener('click', |
111 this.handleLoadUnpackedExtension_.bind(this)); | 111 this.handleLoadUnpackedExtension_.bind(this)); |
112 $('pack-extension').addEventListener('click', | 112 $('pack-extension').addEventListener('click', |
113 this.handlePackExtension_.bind(this)); | 113 this.handlePackExtension_.bind(this)); |
114 $('update-extensions-now').addEventListener('click', | 114 $('update-extensions-now').addEventListener('click', |
115 this.handleUpdateExtensionNow_.bind(this)); | 115 this.handleUpdateExtensionNow_.bind(this)); |
116 | 116 |
117 // Set up the close dialog for the apps developer tools promo. | |
118 this.promoDismissed_ = false; | |
Dan Beam
2014/04/18 23:08:33
nit: move to prototype (see above)
Devlin
2014/04/18 23:41:02
Done.
| |
119 $('apps-developer-tools-promo').querySelector('.close-button'). | |
120 addEventListener('click', function(e) { | |
121 this.promoDismissed_ = true; | |
122 $('extension-settings').classList.remove('adt-promo'); | |
123 }.bind(this)); | |
124 | |
117 if (!loadTimeData.getBoolean('offStoreInstallEnabled')) { | 125 if (!loadTimeData.getBoolean('offStoreInstallEnabled')) { |
118 this.dragWrapper_ = new cr.ui.DragWrapper(document.documentElement, | 126 this.dragWrapper_ = new cr.ui.DragWrapper(document.documentElement, |
119 dragWrapperHandler); | 127 dragWrapperHandler); |
120 } | 128 } |
121 | 129 |
122 extensions.PackExtensionOverlay.getInstance().initializePage(); | 130 extensions.PackExtensionOverlay.getInstance().initializePage(); |
123 | 131 |
124 // Hook up the configure commands link to the overlay. | 132 // Hook up the configure commands link to the overlay. |
125 var link = document.querySelector('.extension-commands-config'); | 133 var link = document.querySelector('.extension-commands-config'); |
126 link.addEventListener('click', | 134 link.addEventListener('click', |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 | 298 |
291 if (extensionsData.developerMode) { | 299 if (extensionsData.developerMode) { |
292 pageDiv.classList.add('dev-mode'); | 300 pageDiv.classList.add('dev-mode'); |
293 $('toggle-dev-on').checked = true; | 301 $('toggle-dev-on').checked = true; |
294 $('dev-controls').hidden = false; | 302 $('dev-controls').hidden = false; |
295 } else { | 303 } else { |
296 pageDiv.classList.remove('dev-mode'); | 304 pageDiv.classList.remove('dev-mode'); |
297 $('toggle-dev-on').checked = false; | 305 $('toggle-dev-on').checked = false; |
298 } | 306 } |
299 | 307 |
308 var showPromo = extensionsData.promoteAppsDevTools && !this.promoDismissed_; | |
309 pageDiv.classList.toggle('adt-promo', showPromo); | |
310 | |
300 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled; | 311 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled; |
301 | 312 |
302 ExtensionsList.prototype.data_ = extensionsData; | 313 ExtensionsList.prototype.data_ = extensionsData; |
303 var extensionList = $('extension-settings-list'); | 314 var extensionList = $('extension-settings-list'); |
304 ExtensionsList.decorate(extensionList); | 315 ExtensionsList.decorate(extensionList); |
305 } | 316 } |
306 | 317 |
307 // Indicate that warning |message| has occured for pack of |crx_path| and | 318 // Indicate that warning |message| has occured for pack of |crx_path| and |
308 // |pem_path| files. Ask if user wants override the warning. Send | 319 // |pem_path| files. Ask if user wants override the warning. Send |
309 // |overrideFlags| to repeated 'pack' call to accomplish the override. | 320 // |overrideFlags| to repeated 'pack' call to accomplish the override. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 | 410 |
400 // Export | 411 // Export |
401 return { | 412 return { |
402 ExtensionSettings: ExtensionSettings | 413 ExtensionSettings: ExtensionSettings |
403 }; | 414 }; |
404 }); | 415 }); |
405 | 416 |
406 window.addEventListener('load', function(e) { | 417 window.addEventListener('load', function(e) { |
407 extensions.ExtensionSettings.getInstance().initialize(); | 418 extensions.ExtensionSettings.getInstance().initialize(); |
408 }); | 419 }); |
OLD | NEW |