Chromium Code Reviews| Index: Source/devtools/front_end/devtools_app/DevToolsApp.js |
| diff --git a/Source/devtools/front_end/devtools_app/DevToolsApp.js b/Source/devtools/front_end/devtools_app/DevToolsApp.js |
| index 988422d53e253b0506a460fe2b37e22c90957e38..89ecc260ddfc0e213d188437860ff783307e6809 100644 |
| --- a/Source/devtools/front_end/devtools_app/DevToolsApp.js |
| +++ b/Source/devtools/front_end/devtools_app/DevToolsApp.js |
| @@ -4,47 +4,38 @@ |
| /** |
| * @constructor |
| - * @implements {InspectorAppHostAPI} |
| + * @suppressGlobalPropertiesCheck |
| */ |
| WebInspector.DevToolsApp = function() |
| { |
| - window.InspectorAppHost = this; |
| - |
| /** |
| * @type {?Window} |
| */ |
| this._inspectorWindow = null; |
| -} |
| -WebInspector.DevToolsApp.prototype = { |
| - /** |
| - * @param {!Window} inspectorWindow |
| - * @override |
| - */ |
| - inspectorAppWindowLoaded: function(inspectorWindow) |
| - { |
| - this._inspectorWindow = inspectorWindow; |
| - if (window.domAutomationController) |
| - this._inspectorWindow.domAutomationController = window.domAutomationController; |
| - }, |
| + this._iframe = document.querySelector("iframe.inspector-app-iframe"); |
|
pfeldman
2014/11/13 17:48:11
just inline onIframeLoaded here.
dgozman
2014/11/13 17:53:27
Done.
|
| /** |
| - * @override |
| + * @this {WebInspector.DevToolsApp} |
| */ |
| - beforeInspectorAppLoad: function() |
| + var loadCallback = (function() |
| { |
| - if (this._inspectorWindow.uiTests) { |
| - // FIXME: move Tests to the host or teach browser counterpart about iframe. |
| - window.uiTests = this._inspectorWindow.uiTests; |
| - } |
| - }, |
| + this._iframe.removeEventListener("load", loadCallback, false); |
| + this._onIframeLoaded(); |
| + }).bind(this); |
| - /** |
| - * @override |
| - */ |
| - afterInspectorAppLoad: function() |
| + if (this._iframe.contentDocument.readyState == "complete") |
| + this._onIframeLoaded(); |
| + else |
| + this._iframe.addEventListener("load", loadCallback, false); |
| +} |
| + |
| +WebInspector.DevToolsApp.prototype = { |
| + _onIframeLoaded: function() |
| { |
| + this._inspectorWindow = this._iframe.contentWindow; |
| + this._inspectorWindow.InspectorFrontendHost = window.InspectorFrontendHost; |
| } |
| } |
| -new WebInspector.DevToolsApp(); |
| +runOnWindowLoad(function() { new WebInspector.DevToolsApp(); }); |