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"> | 5 <include src="../uber/uber_utils.js"> |
6 <include src="extension_code.js"> | 6 <include src="extension_code.js"> |
7 <include src="extension_commands_overlay.js"> | 7 <include src="extension_commands_overlay.js"> |
8 <include src="extension_focus_manager.js"> | 8 <include src="extension_focus_manager.js"> |
9 <include src="extension_list.js"> | 9 <include src="extension_list.js"> |
10 <include src="pack_extension_overlay.js"> | 10 <include src="pack_extension_overlay.js"> |
11 <include src="extension_error_overlay.js"> | 11 <include src="extension_error_overlay.js"> |
12 <include src="extension_loader.js"> | 12 <include src="extension_loader.js"> |
13 | 13 |
14 <if expr="chromeos"> | 14 <if expr="chromeos"> |
15 <include src="chromeos/kiosk_apps.js"> | 15 <include src="chromeos/kiosk_apps.js"> |
16 </if> | 16 </if> |
17 | 17 |
18 /** | |
19 * The type of the extension data object. The definition is based on | |
20 * chrome/browser/ui/webui/extensions/extension_settings_handler.cc: | |
21 * ExtensionSettingsHandler::HandleRequestExtensionsData() | |
22 * @typedef {{developerMode: boolean, | |
23 * extensions: Array, | |
24 * incognitoAvailable: boolean, | |
25 * loadUnpackedDisabled: boolean, | |
26 * profileIsSupervised: boolean, | |
27 * promoteAppsDevTools: boolean}} | |
28 */ | |
29 var BackendExtensionsDataObject; | |
Dan Beam
2014/08/21 18:27:48
ExtensionRequest
Vitaly Pavlenko
2014/08/22 01:43:40
Done.
| |
30 | |
18 // Used for observing function of the backend datasource for this page by | 31 // Used for observing function of the backend datasource for this page by |
19 // tests. | 32 // tests. |
20 var webuiResponded = false; | 33 var webuiResponded = false; |
21 | 34 |
22 cr.define('extensions', function() { | 35 cr.define('extensions', function() { |
23 var ExtensionsList = options.ExtensionsList; | 36 var ExtensionsList = options.ExtensionsList; |
24 | 37 |
25 // Implements the DragWrapper handler interface. | 38 // Implements the DragWrapper handler interface. |
26 var dragWrapperHandler = { | 39 var dragWrapperHandler = { |
27 /** @override */ | 40 /** @override */ |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 */ | 261 */ |
249 handleToggleDevMode_: function(e) { | 262 handleToggleDevMode_: function(e) { |
250 if ($('toggle-dev-on').checked) { | 263 if ($('toggle-dev-on').checked) { |
251 $('dev-controls').hidden = false; | 264 $('dev-controls').hidden = false; |
252 window.setTimeout(function() { | 265 window.setTimeout(function() { |
253 $('extension-settings').classList.add('dev-mode'); | 266 $('extension-settings').classList.add('dev-mode'); |
254 }, 0); | 267 }, 0); |
255 } else { | 268 } else { |
256 $('extension-settings').classList.remove('dev-mode'); | 269 $('extension-settings').classList.remove('dev-mode'); |
257 } | 270 } |
258 window.setTimeout(this.updatePromoVisibility_.bind(this)); | 271 window.setTimeout(this.updatePromoVisibility_.bind(this), 0); |
259 | 272 |
260 chrome.send('extensionSettingsToggleDeveloperMode'); | 273 chrome.send('extensionSettingsToggleDeveloperMode'); |
261 }, | 274 }, |
262 | 275 |
263 /** | 276 /** |
264 * Called when a transition has ended for #dev-controls. | 277 * Called when a transition has ended for #dev-controls. |
265 * @param {Event} e webkitTransitionEnd event. | 278 * @param {Event} e webkitTransitionEnd event. |
266 * @private | 279 * @private |
267 */ | 280 */ |
268 handleDevControlsTransitionEnd_: function(e) { | 281 handleDevControlsTransitionEnd_: function(e) { |
269 if (e.propertyName == 'height' && | 282 if (e.propertyName == 'height' && |
270 !$('extension-settings').classList.contains('dev-mode')) { | 283 !$('extension-settings').classList.contains('dev-mode')) { |
271 $('dev-controls').hidden = true; | 284 $('dev-controls').hidden = true; |
272 } | 285 } |
273 }, | 286 }, |
274 }; | 287 }; |
275 | 288 |
276 /** | 289 /** |
277 * Called by the dom_ui_ to re-populate the page with data representing | 290 * Called by the dom_ui_ to re-populate the page with data representing |
278 * the current state of installed extensions. | 291 * the current state of installed extensions. |
292 * @param {BackendExtensionsDataObject} extensionsData | |
279 */ | 293 */ |
280 ExtensionSettings.returnExtensionsData = function(extensionsData) { | 294 ExtensionSettings.returnExtensionsData = function(extensionsData) { |
281 // We can get called many times in short order, thus we need to | 295 // We can get called many times in short order, thus we need to |
282 // be careful to remove the 'finished loading' timeout. | 296 // be careful to remove the 'finished loading' timeout. |
283 if (this.loadingTimeout_) | 297 if (this.loadingTimeout_) |
284 window.clearTimeout(this.loadingTimeout_); | 298 window.clearTimeout(this.loadingTimeout_); |
285 document.documentElement.classList.add('loading'); | 299 document.documentElement.classList.add('loading'); |
286 this.loadingTimeout_ = window.setTimeout(function() { | 300 this.loadingTimeout_ = window.setTimeout(function() { |
287 document.documentElement.classList.remove('loading'); | 301 document.documentElement.classList.remove('loading'); |
288 }, 0); | 302 }, 0); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 currentlyShowingOverlay.classList.remove('showing'); | 406 currentlyShowingOverlay.classList.remove('showing'); |
393 | 407 |
394 if (node) | 408 if (node) |
395 node.classList.add('showing'); | 409 node.classList.add('showing'); |
396 | 410 |
397 var pages = document.querySelectorAll('.page'); | 411 var pages = document.querySelectorAll('.page'); |
398 for (var i = 0; i < pages.length; i++) { | 412 for (var i = 0; i < pages.length; i++) { |
399 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); | 413 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); |
400 } | 414 } |
401 | 415 |
402 overlay.hidden = !node; | 416 $('overlay').hidden = !node; |
403 uber.invokeMethodOnParent(node ? 'beginInterceptingEvents' : | 417 uber.invokeMethodOnParent(node ? 'beginInterceptingEvents' : |
404 'stopInterceptingEvents'); | 418 'stopInterceptingEvents'); |
405 }; | 419 }; |
406 | 420 |
407 /** | 421 /** |
408 * Utility function to find the width of various UI strings and synchronize | 422 * Utility function to find the width of various UI strings and synchronize |
409 * the width of relevant spans. This is crucial for making sure the | 423 * the width of relevant spans. This is crucial for making sure the |
410 * Enable/Enabled checkboxes align, as well as the Developer Mode checkbox. | 424 * Enable/Enabled checkboxes align, as well as the Developer Mode checkbox. |
411 */ | 425 */ |
412 function measureCheckboxStrings() { | 426 function measureCheckboxStrings() { |
(...skipping 23 matching lines...) Expand all Loading... | |
436 | 450 |
437 // Export | 451 // Export |
438 return { | 452 return { |
439 ExtensionSettings: ExtensionSettings | 453 ExtensionSettings: ExtensionSettings |
440 }; | 454 }; |
441 }); | 455 }); |
442 | 456 |
443 window.addEventListener('load', function(e) { | 457 window.addEventListener('load', function(e) { |
444 extensions.ExtensionSettings.getInstance().initialize(); | 458 extensions.ExtensionSettings.getInstance().initialize(); |
445 }); | 459 }); |
OLD | NEW |