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 26 matching lines...) Expand all Loading... | |
37 var boundListener = windowLoaded.bind(this); | 37 var boundListener = windowLoaded.bind(this); |
38 | 38 |
39 /** | 39 /** |
40 * @this {WebInspector.Main} | 40 * @this {WebInspector.Main} |
41 */ | 41 */ |
42 function windowLoaded() | 42 function windowLoaded() |
43 { | 43 { |
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 |
48 if (!WebInspector.queryParam("toolbox")) | |
49 window.addEventListener("DOMContentLoaded", boundListener, false); | |
48 } | 50 } |
49 | 51 |
50 WebInspector.Main.prototype = { | 52 WebInspector.Main.prototype = { |
51 _registerModules: function() | 53 _registerModules: function() |
52 { | 54 { |
53 var configuration; | 55 var configuration; |
54 if (!Capabilities.isMainFrontend) { | 56 if (!Capabilities.isMainFrontend) { |
55 configuration = ["components", "main", "sources", "timeline", "profi ler", "console", "source_frame", "search"]; | 57 configuration = ["components", "main", "sources", "timeline", "profi ler", "console", "source_frame", "search"]; |
56 } else { | 58 } else { |
57 configuration = ["components", "main", "elements", "network", "sourc es", "timeline", "profiler", "resources", "audits", "console", "source_frame", " extensions", "settings", "search"]; | 59 configuration = ["components", "main", "elements", "network", "sourc es", "timeline", "profiler", "resources", "audits", "console", "source_frame", " extensions", "settings", "search"]; |
(...skipping 14 matching lines...) Expand all Loading... | |
72 if (WebInspector.dockController.element) | 74 if (WebInspector.dockController.element) |
73 WebInspector.inspectorView.appendToRightToolbar(WebInspector.dockCon troller.element); | 75 WebInspector.inspectorView.appendToRightToolbar(WebInspector.dockCon troller.element); |
74 | 76 |
75 if (this._screencastController) | 77 if (this._screencastController) |
76 WebInspector.inspectorView.appendToRightToolbar(this._screencastCont roller.statusBarItem()); | 78 WebInspector.inspectorView.appendToRightToolbar(this._screencastCont roller.statusBarItem()); |
77 }, | 79 }, |
78 | 80 |
79 _createRootView: function() | 81 _createRootView: function() |
80 { | 82 { |
81 var rootView = new WebInspector.RootView(); | 83 var rootView = new WebInspector.RootView(); |
82 | 84 WebInspector.inspectorView.show(rootView.element); |
83 this._rootSplitView = new WebInspector.SplitView(false, true, WebInspect or.dockController.canDock() ? "InspectorView.splitViewState" : "InspectorView.du mmySplitViewState", 300, 300); | |
84 this._rootSplitView.show(rootView.element); | |
85 | |
86 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); | |
87 | |
88 var inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder (); | |
89 if (WebInspector.dockController.canDock() && WebInspector.experimentsSet tings.responsiveDesign.isEnabled()) { | |
90 var responsiveDesignView = new WebInspector.ResponsiveDesignView(ins pectedPagePlaceholder); | |
91 responsiveDesignView.show(this._rootSplitView.mainElement()); | |
92 } else | |
93 inspectedPagePlaceholder.show(this._rootSplitView.mainElement()); | |
94 | |
95 WebInspector.dockController.addEventListener(WebInspector.DockController .Events.DockSideChanged, this._updateRootSplitViewOnDockSideChange, this); | |
96 this._updateRootSplitViewOnDockSideChange(); | |
97 | |
98 rootView.attachToBody(); | 85 rootView.attachToBody(); |
99 }, | 86 }, |
100 | 87 |
101 _updateRootSplitViewOnDockSideChange: function() | |
pfeldman
2014/05/27 15:37:04
Where did this code go?
| |
102 { | |
103 var dockSide = WebInspector.dockController.dockSide(); | |
104 if (dockSide === WebInspector.DockController.State.Undocked) { | |
105 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement (), false); | |
106 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResi zerElement(), false); | |
107 this._rootSplitView.hideMain(); | |
108 return; | |
109 } | |
110 | |
111 this._rootSplitView.setVertical(dockSide === WebInspector.DockController .State.DockedToLeft || dockSide === WebInspector.DockController.State.DockedToRi ght); | |
112 this._rootSplitView.setSecondIsSidebar(dockSide === WebInspector.DockCon troller.State.DockedToRight || dockSide === WebInspector.DockController.State.Do ckedToBottom); | |
113 this._rootSplitView.toggleResizer(this._rootSplitView.resizerElement(), true); | |
114 this._rootSplitView.toggleResizer(WebInspector.inspectorView.topResizerE lement(), dockSide === WebInspector.DockController.State.DockedToBottom); | |
115 this._rootSplitView.showBoth(); | |
116 }, | |
117 | |
118 _calculateWorkerInspectorTitle: function() | 88 _calculateWorkerInspectorTitle: function() |
119 { | 89 { |
120 var expression = "location.href"; | 90 var expression = "location.href"; |
121 if (WebInspector.queryParam("isSharedWorker")) | 91 if (WebInspector.queryParam("isSharedWorker")) |
122 expression += " + (this.name ? ' (' + this.name + ')' : '')"; | 92 expression += " + (this.name ? ' (' + this.name + ')' : '')"; |
123 RuntimeAgent.invoke_evaluate({expression:expression, doNotPauseOnExcepti onsAndMuteConsole:true, returnByValue: true}, evalCallback); | 93 RuntimeAgent.invoke_evaluate({expression:expression, doNotPauseOnExcepti onsAndMuteConsole:true, returnByValue: true}, evalCallback); |
124 | 94 |
125 /** | 95 /** |
126 * @param {?Protocol.Error} error | 96 * @param {?Protocol.Error} error |
127 * @param {!RuntimeAgent.RemoteObject} result | 97 * @param {!RuntimeAgent.RemoteObject} result |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 this._registerModules(); | 321 this._registerModules(); |
352 WebInspector.actionRegistry = new WebInspector.ActionRegistry(); | 322 WebInspector.actionRegistry = new WebInspector.ActionRegistry(); |
353 WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebIns pector.actionRegistry); | 323 WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebIns pector.actionRegistry); |
354 this._registerForwardedShortcuts(); | 324 this._registerForwardedShortcuts(); |
355 | 325 |
356 WebInspector.inspectorView = new WebInspector.InspectorView(); | 326 WebInspector.inspectorView = new WebInspector.InspectorView(); |
357 | 327 |
358 // Screencast controller creates a root view itself. | 328 // Screencast controller creates a root view itself. |
359 if (mainTarget.canScreencast) | 329 if (mainTarget.canScreencast) |
360 this._screencastController = new WebInspector.ScreencastController() ; | 330 this._screencastController = new WebInspector.ScreencastController() ; |
331 else if (WebInspector.dockController.canDock()) | |
332 this._toolbox = new WebInspector.Toolbox(); | |
361 else | 333 else |
362 this._createRootView(); | 334 this._createRootView(); |
363 this._createGlobalStatusBarItems(); | 335 this._createGlobalStatusBarItems(); |
364 | 336 |
365 this._addMainEventListeners(document); | 337 this._addMainEventListeners(document); |
366 | 338 |
367 function onResize() | 339 function onResize() |
368 { | 340 { |
369 if (WebInspector.settingsController) | 341 if (WebInspector.settingsController) |
370 WebInspector.settingsController.resize(); | 342 WebInspector.settingsController.resize(); |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
816 | 788 |
817 WebInspector.__defineGetter__("inspectedPageURL", function() | 789 WebInspector.__defineGetter__("inspectedPageURL", function() |
818 { | 790 { |
819 return WebInspector.resourceTreeModel.inspectedPageURL(); | 791 return WebInspector.resourceTreeModel.inspectedPageURL(); |
820 }); | 792 }); |
821 | 793 |
822 WebInspector.panel = function(name) | 794 WebInspector.panel = function(name) |
823 { | 795 { |
824 return WebInspector.inspectorView.panel(name); | 796 return WebInspector.inspectorView.panel(name); |
825 } | 797 } |
OLD | NEW |