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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 }, | 315 }, |
316 | 316 |
317 /** | 317 /** |
318 * @param {?WebInspector.Target} target | 318 * @param {?WebInspector.Target} target |
319 */ | 319 */ |
320 _mainTargetCreated: function(target) | 320 _mainTargetCreated: function(target) |
321 { | 321 { |
322 console.timeStamp("Main._mainTargetCreated"); | 322 console.timeStamp("Main._mainTargetCreated"); |
323 this._mainTarget = /** @type {!WebInspector.Target} */(target); | 323 this._mainTarget = /** @type {!WebInspector.Target} */(target); |
324 this._registerShortcuts(); | 324 this._registerShortcuts(); |
| 325 var main = this; |
325 | 326 |
326 this._mainTarget.registerInspectorDispatcher(this); | 327 this._mainTarget.registerInspectorDispatcher(this); |
327 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.E
vents.ReloadInspectedPage, this._reloadInspectedPage, this); | 328 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.E
vents.ReloadInspectedPage, this._reloadInspectedPage, this); |
328 | 329 |
329 if (this._mainTarget.isServiceWorker()) | 330 if (this._mainTarget.isServiceWorker()) |
330 this._mainTarget.runtimeAgent().run(); | 331 this._mainTarget.runtimeAgent().run(); |
331 | 332 |
332 WebInspector.overridesSupport.init(this._mainTarget, overridesReady); | 333 WebInspector.overridesSupport.init(this._mainTarget, overridesReady); |
333 | 334 |
334 function overridesReady() | 335 function overridesReady() |
335 { | 336 { |
336 if (!WebInspector.dockController.canDock() && WebInspector.overrides
Support.emulationEnabled()) | 337 if (!WebInspector.dockController.canDock() && WebInspector.overrides
Support.emulationEnabled()) |
337 WebInspector.inspectorView.showViewInDrawer("emulation", true); | 338 WebInspector.inspectorView.showViewInDrawer("emulation", true); |
338 | 339 |
339 target.inspectorAgent().enable(inspectorAgentEnableCallback); | 340 target.inspectorAgent().enable(inspectorAgentEnableCallback); |
340 } | 341 } |
341 | 342 |
342 function inspectorAgentEnableCallback() | 343 function inspectorAgentEnableCallback() |
343 { | 344 { |
344 console.timeStamp("Main.inspectorAgentEnableCallback"); | 345 console.timeStamp("Main.inspectorAgentEnableCallback"); |
345 WebInspector.notifications.dispatchEventToListeners(WebInspector.Not
ificationService.Events.InspectorAgentEnabledForTests); | 346 WebInspector.notifications.dispatchEventToListeners(WebInspector.Not
ificationService.Events.InspectorAgentEnabledForTests); |
346 // Asynchronously run the extensions. | 347 // Asynchronously run the extensions. |
347 setTimeout(function() { WebInspector.extensionServer.initializeExten
sions(); }, 0); | 348 setTimeout(lateInitialization, 0); |
| 349 } |
| 350 |
| 351 function lateInitialization() |
| 352 { |
| 353 WebInspector.extensionServer.initializeExtensions(); |
| 354 new WebInspector.FrontendWebSocketAPI(); |
348 } | 355 } |
349 }, | 356 }, |
350 | 357 |
351 _registerForwardedShortcuts: function() | 358 _registerForwardedShortcuts: function() |
352 { | 359 { |
353 /** @const */ var forwardedActions = ["main.reload", "main.hard-reload",
"main.toggle-dock", "debugger.toggle-breakpoints-active", "debugger.toggle-paus
e"]; | 360 /** @const */ var forwardedActions = ["main.reload", "main.hard-reload",
"main.toggle-dock", "debugger.toggle-breakpoints-active", "debugger.toggle-paus
e"]; |
354 var actionKeys = WebInspector.shortcutRegistry.keysForActions(forwardedA
ctions).map(WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey); | 361 var actionKeys = WebInspector.shortcutRegistry.keysForActions(forwardedA
ctions).map(WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey); |
355 | 362 |
356 actionKeys.push({keyCode: WebInspector.KeyboardShortcut.Keys.F8.code}); | 363 actionKeys.push({keyCode: WebInspector.KeyboardShortcut.Keys.F8.code}); |
357 InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)
); | 364 InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)
); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 p.classList.add("help-section"); | 939 p.classList.add("help-section"); |
933 p.textContent = WebInspector.UIString("Inspected worker has terminated. Once
it restarts we will attach to it automatically."); | 940 p.textContent = WebInspector.UIString("Inspected worker has terminated. Once
it restarts we will attach to it automatically."); |
934 } | 941 } |
935 | 942 |
936 WebInspector.WorkerTerminatedScreen.prototype = { | 943 WebInspector.WorkerTerminatedScreen.prototype = { |
937 | 944 |
938 __proto__: WebInspector.HelpScreen.prototype | 945 __proto__: WebInspector.HelpScreen.prototype |
939 } | 946 } |
940 | 947 |
941 new WebInspector.Main(); | 948 new WebInspector.Main(); |
OLD | NEW |