Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6020)

Unified Diff: chrome/browser/resources/task_manager/includes.js

Issue 8873054: Revert 113772 - WebUI TaskManager: Optimize initialization taskmanager and loading scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/task_manager/main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/task_manager/includes.js
===================================================================
--- chrome/browser/resources/task_manager/includes.js (revision 113775)
+++ chrome/browser/resources/task_manager/includes.js (working copy)
@@ -2,9 +2,44 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This script loads additional scripts after initialization of task manager.
+// This script includes additional resources via document.write(). Hence, it
+// must be a separate script file loaded before other scripts which would
+// reference the resources.
+var css = [
+ 'chrome_shared.css',
+ 'list.css',
+ 'table.css',
+ 'menu.css',
+ 'button.css',
+];
+
var script = [
+ 'local_strings.js',
+ 'i18n_template.js',
+
+ 'util.js',
+ 'cr.js',
+ 'cr/ui.js',
+ 'cr/event_target.js',
+ 'cr/ui/array_data_model.js',
+ 'cr/ui/list_item.js',
+ 'cr/ui/list_selection_model.js',
+ 'cr/ui/list_single_selection_model.js',
+ 'cr/ui/list_selection_controller.js',
+ 'cr/ui/list.js',
+
+ 'cr/ui/splitter.js',
+ 'cr/ui/table/table_splitter.js',
+
+ 'cr/ui/table/table_column.js',
+ 'cr/ui/table/table_column_model.js',
+ 'cr/ui/table/table_header.js',
+ 'cr/ui/table/table_list.js',
+ 'cr/ui/table.js',
+
+ 'cr/ui/grid.js',
+
'cr/ui/command.js',
'cr/ui/position_util.js',
'cr/ui/menu_item.js',
@@ -12,30 +47,20 @@
'cr/ui/context_menu_handler.js',
];
-/**
- * Loads delayed scripts.
- * This function is called by TaskManager::initalize() in main.js.
- */
-function loadDelayedIncludes(taskmanager) {
+(function() {
// Switch to 'test harness' mode when loading from a file url.
var isHarness = document.location.protocol == 'file:';
// In test harness mode we load resources from relative dirs.
var prefix = isHarness ? './shared/' : 'chrome://resources/';
- // Number of remaining scripts to load.
- var remain = script.length;
+ for (var i = 0; i < css.length; ++i) {
+ document.write('<link href="' + prefix + 'css/' + css[i] +
+ '" rel="stylesheet"></link>');
+ }
- // Waits for initialization of task manager.
for (var i = 0; i < script.length; ++i) {
- var s = document.createElement('script');
- s.onload = function(e) {
- if (!--remain)
- taskmanager.delayedInitialize();
- };
- s.type = 'text/javascript';
- s.src = prefix + 'js/' + script[i];
- s.defer = 'defer';
- document.body.appendChild(s);
+ document.write('<script src="' + prefix + 'js/' + script[i] +
+ '"><\/script>');
}
-}
+})();
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/task_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698