OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @implements {InspectorAppHostAPI} | 7 * @suppressGlobalPropertiesCheck |
8 */ | 8 */ |
9 WebInspector.DevToolsApp = function() | 9 WebInspector.DevToolsApp = function() |
10 { | 10 { |
11 window.InspectorAppHost = this; | 11 this._iframe = document.querySelector("iframe.inspector-app-iframe"); |
12 | 12 |
13 /** | 13 /** |
14 * @type {?Window} | 14 * @type {!Window} |
15 */ | 15 */ |
16 this._inspectorWindow = null; | 16 this._inspectorWindow = this._iframe.contentWindow; |
| 17 this._inspectorWindow.InspectorFrontendHost = window.InspectorFrontendHost; |
17 } | 18 } |
18 | 19 |
19 WebInspector.DevToolsApp.prototype = { | 20 WebInspector.DevToolsApp.prototype = { |
20 /** | |
21 * @param {!Window} inspectorWindow | |
22 * @override | |
23 */ | |
24 inspectorAppWindowLoaded: function(inspectorWindow) | |
25 { | |
26 this._inspectorWindow = inspectorWindow; | |
27 if (window.domAutomationController) | |
28 this._inspectorWindow.domAutomationController = window.domAutomation
Controller; | |
29 }, | |
30 | |
31 /** | |
32 * @override | |
33 */ | |
34 beforeInspectorAppLoad: function() | |
35 { | |
36 if (this._inspectorWindow.uiTests) { | |
37 // FIXME: move Tests to the host or teach browser counterpart about
iframe. | |
38 window.uiTests = this._inspectorWindow.uiTests; | |
39 } | |
40 }, | |
41 | |
42 /** | |
43 * @override | |
44 */ | |
45 afterInspectorAppLoad: function() | |
46 { | |
47 } | |
48 } | 21 } |
49 | 22 |
50 new WebInspector.DevToolsApp(); | 23 runOnWindowLoad(function() { new WebInspector.DevToolsApp(); }); |
OLD | NEW |