Index: Source/devtools/front_end/main/Main.js |
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js |
index 13556ec891984c54b738138ffb231b148243d28d..e74bbe7bb606029962f9fa47e4bcd6c5fe618a45 100644 |
--- a/Source/devtools/front_end/main/Main.js |
+++ b/Source/devtools/front_end/main/Main.js |
@@ -36,23 +36,13 @@ |
*/ |
WebInspector.Main = function() |
{ |
- var boundListener = windowLoaded.bind(this); |
- WebInspector.console.setUIDelegate(this); |
- if (document.readyState === "complete") { |
- this._loaded(); |
+ if (!InspectorAppHost) { |
+ console.error("Inspector should be embedded."); |
return; |
} |
- |
- /** |
- * @suppressGlobalPropertiesCheck |
- * @this {WebInspector.Main} |
- */ |
- function windowLoaded() |
- { |
- this._loaded(); |
- window.removeEventListener("DOMContentLoaded", boundListener, false); |
- } |
- window.addEventListener("DOMContentLoaded", boundListener, false); |
+ InspectorAppHost.beforeInspectorAppLoad(); |
+ WebInspector.console.setUIDelegate(this); |
+ runOnWindowLoad(this._loaded.bind(this)); |
} |
WebInspector.Main.prototype = { |
@@ -270,6 +260,7 @@ WebInspector.Main.prototype = { |
WebInspector.inspectElementModeController = new WebInspector.InspectElementModeController(); |
this._createGlobalStatusBarItems(); |
+ InspectorAppHost.afterInspectorAppLoad(); |
InspectorFrontendHost.loadCompleted(); |
// Give UI cycles to repaint, then proceed with creating connection. |