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 |
| 11 <if expr="pp_ifdef('chromeos')"> |
| 12 <include src="chromeos/kiosk_apps.js"></include> |
| 13 </if> |
| 14 |
11 // Used for observing function of the backend datasource for this page by | 15 // Used for observing function of the backend datasource for this page by |
12 // tests. | 16 // tests. |
13 var webuiResponded = false; | 17 var webuiResponded = false; |
14 | 18 |
15 cr.define('extensions', function() { | 19 cr.define('extensions', function() { |
16 var ExtensionsList = options.ExtensionsList; | 20 var ExtensionsList = options.ExtensionsList; |
17 | 21 |
18 // Implements the DragWrapper handler interface. | 22 // Implements the DragWrapper handler interface. |
19 var dragWrapperHandler = { | 23 var dragWrapperHandler = { |
20 // @inheritdoc | 24 // @inheritdoc |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Hook up the configure commands link to the overlay. | 110 // Hook up the configure commands link to the overlay. |
107 var link = document.querySelector('.extension-commands-config'); | 111 var link = document.querySelector('.extension-commands-config'); |
108 link.addEventListener('click', | 112 link.addEventListener('click', |
109 this.handleExtensionCommandsConfig_.bind(this)); | 113 this.handleExtensionCommandsConfig_.bind(this)); |
110 | 114 |
111 // Initialize the Commands overlay. | 115 // Initialize the Commands overlay. |
112 var extensionCommandsOverlay = | 116 var extensionCommandsOverlay = |
113 extensions.ExtensionCommandsOverlay.getInstance(); | 117 extensions.ExtensionCommandsOverlay.getInstance(); |
114 extensionCommandsOverlay.initializePage(); | 118 extensionCommandsOverlay.initializePage(); |
115 | 119 |
| 120 // Initialize the kiosk overlay. |
| 121 if (cr.isChromeOS && loadTimeData.getBoolean('enableKiosk')) { |
| 122 var kioskOverlay = extensions.KioskAppsOverlay.getInstance(); |
| 123 kioskOverlay.initialize(); |
| 124 |
| 125 $('add-kiosk-app').hidden = false; |
| 126 $('add-kiosk-app').addEventListener('click', function() { |
| 127 ExtensionSettings.showOverlay($('kiosk-apps-page')); |
| 128 kioskOverlay.didShowPage(); |
| 129 }); |
| 130 |
| 131 extensions.KioskDisableBailoutConfirm.getInstance().initialize(); |
| 132 } |
| 133 |
116 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); | 134 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); |
117 | 135 |
118 extensions.ExtensionFocusManager.getInstance().initialize(); | 136 extensions.ExtensionFocusManager.getInstance().initialize(); |
119 | 137 |
120 var path = document.location.pathname; | 138 var path = document.location.pathname; |
121 if (path.length > 1) { | 139 if (path.length > 1) { |
122 // Skip starting slash and remove trailing slash (if any). | 140 // Skip starting slash and remove trailing slash (if any). |
123 var overlayName = path.slice(1).replace(/\/$/, ''); | 141 var overlayName = path.slice(1).replace(/\/$/, ''); |
124 if (overlayName == 'configureCommands') | 142 if (overlayName == 'configureCommands') |
125 this.showExtensionCommandsConfigUi_(); | 143 this.showExtensionCommandsConfigUi_(); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return { | 376 return { |
359 ExtensionSettings: ExtensionSettings | 377 ExtensionSettings: ExtensionSettings |
360 }; | 378 }; |
361 }); | 379 }); |
362 | 380 |
363 var ExtensionSettings = extensions.ExtensionSettings; | 381 var ExtensionSettings = extensions.ExtensionSettings; |
364 | 382 |
365 window.addEventListener('load', function(e) { | 383 window.addEventListener('load', function(e) { |
366 ExtensionSettings.getInstance().initialize(); | 384 ExtensionSettings.getInstance().initialize(); |
367 }); | 385 }); |
OLD | NEW |