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.initializePage(); | |
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 var kioskDisableBailoutConfirmOverlay = | |
132 extensions.KioskDisableBailoutConfirm.getInstance(); | |
Dan Beam
2013/05/30 21:14:55
nit: extensions.KioskDisableBailoutConfirm.getInst
xiyuan
2013/05/30 23:03:38
Done.
| |
133 kioskDisableBailoutConfirmOverlay.initializePage(); | |
134 } | |
135 | |
116 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); | 136 cr.ui.overlay.setupOverlay($('dropTargetOverlay')); |
117 | 137 |
118 extensions.ExtensionFocusManager.getInstance().initialize(); | 138 extensions.ExtensionFocusManager.getInstance().initialize(); |
119 | 139 |
120 var path = document.location.pathname; | 140 var path = document.location.pathname; |
121 if (path.length > 1) { | 141 if (path.length > 1) { |
122 // Skip starting slash and remove trailing slash (if any). | 142 // Skip starting slash and remove trailing slash (if any). |
123 var overlayName = path.slice(1).replace(/\/$/, ''); | 143 var overlayName = path.slice(1).replace(/\/$/, ''); |
124 if (overlayName == 'configureCommands') | 144 if (overlayName == 'configureCommands') |
125 this.showExtensionCommandsConfigUi_(); | 145 this.showExtensionCommandsConfigUi_(); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 return { | 378 return { |
359 ExtensionSettings: ExtensionSettings | 379 ExtensionSettings: ExtensionSettings |
360 }; | 380 }; |
361 }); | 381 }); |
362 | 382 |
363 var ExtensionSettings = extensions.ExtensionSettings; | 383 var ExtensionSettings = extensions.ExtensionSettings; |
364 | 384 |
365 window.addEventListener('load', function(e) { | 385 window.addEventListener('load', function(e) { |
366 ExtensionSettings.getInstance().initialize(); | 386 ExtensionSettings.getInstance().initialize(); |
367 }); | 387 }); |
OLD | NEW |