OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 this._loaded(); | 44 this._loaded(); |
45 window.removeEventListener("DOMContentLoaded", boundListener, false); | 45 window.removeEventListener("DOMContentLoaded", boundListener, false); |
46 } | 46 } |
47 window.addEventListener("DOMContentLoaded", boundListener, false); | 47 window.addEventListener("DOMContentLoaded", boundListener, false); |
48 } | 48 } |
49 | 49 |
50 WebInspector.Main.prototype = { | 50 WebInspector.Main.prototype = { |
51 _registerModules: function() | 51 _registerModules: function() |
52 { | 52 { |
53 var configuration; | 53 var configuration; |
54 if (!Capabilities.isMainFrontend) { | 54 if (WebInspector.isWorkerFrontend()) { |
55 configuration = ["main", "sources", "timeline", "profiler", "console
", "source_frame"]; | 55 configuration = ["main", "sources", "timeline", "profiler", "console
", "source_frame"]; |
56 } else { | 56 } else { |
57 configuration = ["main", "elements", "network", "sources", "timeline
", "profiler", "resources", "audits", "console", "source_frame", "extensions", "
settings"]; | 57 configuration = ["main", "elements", "network", "sources", "timeline
", "profiler", "resources", "audits", "console", "source_frame", "extensions", "
settings"]; |
58 if (WebInspector.experimentsSettings.layersPanel.isEnabled()) | 58 if (WebInspector.experimentsSettings.layersPanel.isEnabled()) |
59 configuration.push("layers"); | 59 configuration.push("layers"); |
60 if (WebInspector.experimentsSettings.devicesPanel.isEnabled() && !We
bInspector.targetManager.activeTarget().isMobile()) | 60 if (WebInspector.experimentsSettings.devicesPanel.isEnabled() && !We
bInspector.targetManager.activeTarget().isMobile()) |
61 configuration.push("devices"); | 61 configuration.push("devices"); |
62 } | 62 } |
63 WebInspector.moduleManager.registerModules(configuration); | 63 WebInspector.moduleManager.registerModules(configuration); |
64 }, | 64 }, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 RuntimeAgent.isRunRequired(isRunRequiredCallback.bind(this)); | 139 RuntimeAgent.isRunRequired(isRunRequiredCallback.bind(this)); |
140 } | 140 } |
141 | 141 |
142 /** | 142 /** |
143 * @this {WebInspector.Main} | 143 * @this {WebInspector.Main} |
144 */ | 144 */ |
145 function isRunRequiredCallback(error, result) | 145 function isRunRequiredCallback(error, result) |
146 { | 146 { |
147 if (result) { | 147 if (result) { |
148 pauseAndResume.call(this); | 148 pauseAndResume.call(this); |
149 } else if (!Capabilities.isMainFrontend) { | 149 } else if (WebInspector.isWorkerFrontend()) { |
150 calculateTitle.call(this); | 150 calculateTitle.call(this); |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 /** | 154 /** |
155 * @this {WebInspector.Main} | 155 * @this {WebInspector.Main} |
156 */ | 156 */ |
157 function pauseAndResume() | 157 function pauseAndResume() |
158 { | 158 { |
159 DebuggerAgent.pause(); | 159 DebuggerAgent.pause(); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 /** | 268 /** |
269 * @param {!WebInspector.Target} mainTarget | 269 * @param {!WebInspector.Target} mainTarget |
270 */ | 270 */ |
271 _mainTargetCreated: function(mainTarget) | 271 _mainTargetCreated: function(mainTarget) |
272 { | 272 { |
273 console.timeStamp("Main._mainTargetCreated"); | 273 console.timeStamp("Main._mainTargetCreated"); |
274 WebInspector.dockController = new WebInspector.DockController(!!WebInspe
ctor.queryParam("can_dock")); | 274 WebInspector.dockController = new WebInspector.DockController(!!WebInspe
ctor.queryParam("can_dock")); |
275 WebInspector.overridesSupport = new WebInspector.OverridesSupport(WebIns
pector.dockController.canDock()); | 275 WebInspector.overridesSupport = new WebInspector.OverridesSupport(WebIns
pector.dockController.canDock()); |
276 | 276 |
277 if (mainTarget.canScreencast) | 277 if (mainTarget.hasCapability(WebInspector.Target.Capabilities.canScreenc
ast)) |
278 WebInspector.app = new WebInspector.ScreencastApp(); | 278 WebInspector.app = new WebInspector.ScreencastApp(); |
279 else if (WebInspector.dockController.canDock()) | 279 else if (WebInspector.dockController.canDock()) |
280 WebInspector.app = new WebInspector.AdvancedApp(); | 280 WebInspector.app = new WebInspector.AdvancedApp(); |
281 else | 281 else |
282 WebInspector.app = new WebInspector.SimpleApp(); | 282 WebInspector.app = new WebInspector.SimpleApp(); |
283 | 283 |
284 WebInspector.dockController.initialize(); | 284 WebInspector.dockController.initialize(); |
285 | 285 |
286 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); | 286 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); |
287 this._registerShortcuts(); | 287 this._registerShortcuts(); |
288 | 288 |
289 // set order of some sections explicitly | 289 // set order of some sections explicitly |
290 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console")); | 290 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console")); |
291 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Pan
el")); | 291 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Pan
el")); |
292 | 292 |
293 if (WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) | 293 if (WebInspector.experimentsSettings.workersInMainWindow.isEnabled()) |
294 WebInspector.workerTargetManager = new WebInspector.WorkerTargetMana
ger(mainTarget, WebInspector.targetManager); | 294 WebInspector.workerTargetManager = new WebInspector.WorkerTargetMana
ger(mainTarget, WebInspector.targetManager); |
295 | 295 |
296 InspectorBackend.registerInspectorDispatcher(this); | 296 InspectorBackend.registerInspectorDispatcher(this); |
297 | 297 |
298 if (Capabilities.isMainFrontend) { | 298 if (!WebInspector.isWorkerFrontend()) { |
299 WebInspector.inspectElementModeController = new WebInspector.Inspect
ElementModeController(); | 299 WebInspector.inspectElementModeController = new WebInspector.Inspect
ElementModeController(); |
300 WebInspector.workerFrontendManager = new WebInspector.WorkerFrontend
Manager(); | 300 WebInspector.workerFrontendManager = new WebInspector.WorkerFrontend
Manager(); |
301 } else { | 301 } else { |
302 mainTarget.workerManager.addEventListener(WebInspector.WorkerManager
.Events.WorkerDisconnected, onWorkerDisconnected); | 302 mainTarget.workerManager.addEventListener(WebInspector.WorkerManager
.Events.WorkerDisconnected, onWorkerDisconnected); |
303 } | 303 } |
304 | 304 |
305 function onWorkerDisconnected() | 305 function onWorkerDisconnected() |
306 { | 306 { |
307 var screen = new WebInspector.WorkerTerminatedScreen(); | 307 var screen = new WebInspector.WorkerTerminatedScreen(); |
308 var listener = hideScreen.bind(null, screen); | 308 var listener = hideScreen.bind(null, screen); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 var targets = WebInspector.targetManager.targets(); | 892 var targets = WebInspector.targetManager.targets(); |
893 for (var i = 0; i < targets.length; ++i) | 893 for (var i = 0; i < targets.length; ++i) |
894 targets[i].debuggerModel.removeEventListener(WebInspector.DebuggerMo
del.Events.DebuggerPaused, this._debuggerPaused, this); | 894 targets[i].debuggerModel.removeEventListener(WebInspector.DebuggerMo
del.Events.DebuggerPaused, this._debuggerPaused, this); |
895 | 895 |
896 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.ta
rget); | 896 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.ta
rget); |
897 WebInspector.context.setFlavor(WebInspector.Target, debuggerModel.target
()); | 897 WebInspector.context.setFlavor(WebInspector.Target, debuggerModel.target
()); |
898 WebInspector.targetManager.unobserveTargets(this); | 898 WebInspector.targetManager.unobserveTargets(this); |
899 WebInspector.inspectorView.showPanel("sources"); | 899 WebInspector.inspectorView.showPanel("sources"); |
900 } | 900 } |
901 } | 901 } |
OLD | NEW |