| 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 // Used for observing function of the backend datasource for this page by | 11 // Used for observing function of the backend datasource for this page by |
| 12 // tests. | 12 // tests. |
| 13 var webui_responded_ = false; | 13 var webuiResponded = false; |
| 14 | 14 |
| 15 cr.define('extensions', function() { | 15 cr.define('extensions', function() { |
| 16 var ExtensionsList = options.ExtensionsList; | 16 var ExtensionsList = options.ExtensionsList; |
| 17 | 17 |
| 18 // Implements the DragWrapper handler interface. | 18 // Implements the DragWrapper handler interface. |
| 19 var dragWrapperHandler = { | 19 var dragWrapperHandler = { |
| 20 // @inheritdoc | 20 // @inheritdoc |
| 21 shouldAcceptDrag: function(e) { | 21 shouldAcceptDrag: function(e) { |
| 22 // We can't access filenames during the 'dragenter' event, so we have to | 22 // We can't access filenames during the 'dragenter' event, so we have to |
| 23 // wait until 'drop' to decide whether to do something with the file or | 23 // wait until 'drop' to decide whether to do something with the file or |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 ExtensionSettings.returnExtensionsData = function(extensionsData) { | 227 ExtensionSettings.returnExtensionsData = function(extensionsData) { |
| 228 // We can get called many times in short order, thus we need to | 228 // We can get called many times in short order, thus we need to |
| 229 // be careful to remove the 'finished loading' timeout. | 229 // be careful to remove the 'finished loading' timeout. |
| 230 if (this.loadingTimeout_) | 230 if (this.loadingTimeout_) |
| 231 window.clearTimeout(this.loadingTimeout_); | 231 window.clearTimeout(this.loadingTimeout_); |
| 232 document.documentElement.classList.add('loading'); | 232 document.documentElement.classList.add('loading'); |
| 233 this.loadingTimeout_ = window.setTimeout(function() { | 233 this.loadingTimeout_ = window.setTimeout(function() { |
| 234 document.documentElement.classList.remove('loading'); | 234 document.documentElement.classList.remove('loading'); |
| 235 }, 0); | 235 }, 0); |
| 236 | 236 |
| 237 webui_responded_ = true; | 237 webuiResponded = true; |
| 238 | 238 |
| 239 if (extensionsData.extensions.length > 0) { | 239 if (extensionsData.extensions.length > 0) { |
| 240 // Enforce order specified in the data or (if equal) then sort by | 240 // Enforce order specified in the data or (if equal) then sort by |
| 241 // extension name (case-insensitive). | 241 // extension name (case-insensitive). |
| 242 extensionsData.extensions.sort(function(a, b) { | 242 extensionsData.extensions.sort(function(a, b) { |
| 243 if (a.order == b.order) { | 243 if (a.order == b.order) { |
| 244 a = a.name.toLowerCase(); | 244 a = a.name.toLowerCase(); |
| 245 b = b.name.toLowerCase(); | 245 b = b.name.toLowerCase(); |
| 246 return a < b ? -1 : (a > b ? 1 : 0); | 246 return a < b ? -1 : (a > b ? 1 : 0); |
| 247 } else { | 247 } else { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 return { | 373 return { |
| 374 ExtensionSettings: ExtensionSettings | 374 ExtensionSettings: ExtensionSettings |
| 375 }; | 375 }; |
| 376 }); | 376 }); |
| 377 | 377 |
| 378 var ExtensionSettings = extensions.ExtensionSettings; | 378 var ExtensionSettings = extensions.ExtensionSettings; |
| 379 | 379 |
| 380 window.addEventListener('load', function(e) { | 380 window.addEventListener('load', function(e) { |
| 381 ExtensionSettings.getInstance().initialize(); | 381 ExtensionSettings.getInstance().initialize(); |
| 382 }); | 382 }); |
| OLD | NEW |