Chromium Code Reviews| 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 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 | 109 |
| 110 // Initialize the Commands overlay. | 110 // Initialize the Commands overlay. |
| 111 var extensionCommandsOverlay = | 111 var extensionCommandsOverlay = |
| 112 extensions.ExtensionCommandsOverlay.getInstance(); | 112 extensions.ExtensionCommandsOverlay.getInstance(); |
| 113 extensionCommandsOverlay.initializePage(); | 113 extensionCommandsOverlay.initializePage(); |
| 114 | 114 |
| 115 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); | 115 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); |
| 116 | 116 |
| 117 extensions.ExtensionFocusManager.getInstance().initialize(); | 117 extensions.ExtensionFocusManager.getInstance().initialize(); |
| 118 | 118 |
| 119 var path = document.location.pathname; | |
| 120 if (path.length > 1) { | |
| 121 // Skip starting slash and remove trailing slash (if any). | |
| 122 var overlayName = path.slice(1).replace(/\/$/, ''); | |
| 123 if (overlayName == 'configureCommands') | |
| 124 this.showExtensionCommandsConfigUi_(); | |
| 125 } | |
|
Finnur
2012/08/31 16:29:31
I opted for a similar but simpler scheme of openin
| |
| 126 | |
| 119 preventDefaultOnPoundLinkClicks(); // From shared/js/util.js. | 127 preventDefaultOnPoundLinkClicks(); // From shared/js/util.js. |
| 120 }, | 128 }, |
| 121 | 129 |
| 122 /** | 130 /** |
| 123 * Handles the Load Unpacked Extension button. | 131 * Handles the Load Unpacked Extension button. |
| 124 * @param {Event} e Change event. | 132 * @param {Event} e Change event. |
| 125 * @private | 133 * @private |
| 126 */ | 134 */ |
| 127 handleLoadUnpackedExtension_: function(e) { | 135 handleLoadUnpackedExtension_: function(e) { |
| 128 chrome.send('extensionSettingsLoadUnpackedExtension'); | 136 chrome.send('extensionSettingsLoadUnpackedExtension'); |
| 129 | 137 |
| 130 // TODO(jhawkins): Refactor metrics support out of options and use it | 138 // TODO(jhawkins): Refactor metrics support out of options and use it |
| 131 // in extensions.html. | 139 // in extensions.html. |
| 132 chrome.send('coreOptionsUserMetricsAction', | 140 chrome.send('coreOptionsUserMetricsAction', |
| 133 ['Options_LoadUnpackedExtension']); | 141 ['Options_LoadUnpackedExtension']); |
| 134 }, | 142 }, |
| 135 | 143 |
| 136 /** | 144 /** |
| 137 * Handles the Pack Extension button. | 145 * Handles the Pack Extension button. |
| 138 * @param {Event} e Change event. | 146 * @param {Event} e Change event. |
| 139 * @private | 147 * @private |
| 140 */ | 148 */ |
| 141 handlePackExtension_: function(e) { | 149 handlePackExtension_: function(e) { |
| 142 ExtensionSettings.showOverlay($('packExtensionOverlay')); | 150 ExtensionSettings.showOverlay($('packExtensionOverlay')); |
| 143 chrome.send('coreOptionsUserMetricsAction', ['Options_PackExtension']); | 151 chrome.send('coreOptionsUserMetricsAction', ['Options_PackExtension']); |
| 144 }, | 152 }, |
| 145 | 153 |
| 146 /** | 154 /** |
| 155 * Shows the Extension Commands configuration UI. | |
| 156 * @param {Event} e Change event. | |
| 157 * @private | |
| 158 */ | |
| 159 showExtensionCommandsConfigUi_: function(e) { | |
| 160 ExtensionSettings.showOverlay($('extensionCommandsOverlay')); | |
| 161 chrome.send('coreOptionsUserMetricsAction', | |
| 162 ['Options_ExtensionCommands']); | |
| 163 }, | |
| 164 | |
| 165 /** | |
| 147 * Handles the Configure (Extension) Commands link. | 166 * Handles the Configure (Extension) Commands link. |
| 148 * @param {Event} e Change event. | 167 * @param {Event} e Change event. |
| 149 * @private | 168 * @private |
| 150 */ | 169 */ |
| 151 handleExtensionCommandsConfig_: function(e) { | 170 handleExtensionCommandsConfig_: function(e) { |
| 152 ExtensionSettings.showOverlay($('extensionCommandsOverlay')); | 171 this.showExtensionCommandsConfigUi_(); |
| 153 chrome.send('coreOptionsUserMetricsAction', | |
| 154 ['Options_ExtensionCommands']); | |
| 155 }, | 172 }, |
| 156 | 173 |
| 157 /** | 174 /** |
| 158 * Handles the Update Extension Now button. | 175 * Handles the Update Extension Now button. |
| 159 * @param {Event} e Change event. | 176 * @param {Event} e Change event. |
| 160 * @private | 177 * @private |
| 161 */ | 178 */ |
| 162 handleUpdateExtensionNow_: function(e) { | 179 handleUpdateExtensionNow_: function(e) { |
| 163 chrome.send('extensionSettingsAutoupdate'); | 180 chrome.send('extensionSettingsAutoupdate'); |
| 164 }, | 181 }, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 return { | 350 return { |
| 334 ExtensionSettings: ExtensionSettings | 351 ExtensionSettings: ExtensionSettings |
| 335 }; | 352 }; |
| 336 }); | 353 }); |
| 337 | 354 |
| 338 var ExtensionSettings = extensions.ExtensionSettings; | 355 var ExtensionSettings = extensions.ExtensionSettings; |
| 339 | 356 |
| 340 window.addEventListener('load', function(e) { | 357 window.addEventListener('load', function(e) { |
| 341 ExtensionSettings.getInstance().initialize(); | 358 ExtensionSettings.getInstance().initialize(); |
| 342 }); | 359 }); |
| OLD | NEW |