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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 /** | 100 /** |
101 * @param {!Object<string, string>} prefs | 101 * @param {!Object<string, string>} prefs |
102 */ | 102 */ |
103 _initializeExperiments: function(prefs) | 103 _initializeExperiments: function(prefs) |
104 { | 104 { |
105 Runtime.experiments.register("accessibilityInspection", "Accessibility I nspection"); | 105 Runtime.experiments.register("accessibilityInspection", "Accessibility I nspection"); |
106 Runtime.experiments.register("applyCustomStylesheet", "Allow custom UI t hemes"); | 106 Runtime.experiments.register("applyCustomStylesheet", "Allow custom UI t hemes"); |
107 Runtime.experiments.register("blackboxJSFramesOnTimeline", "Blackbox Jav aScript frames on Timeline", true); | 107 Runtime.experiments.register("blackboxJSFramesOnTimeline", "Blackbox Jav aScript frames on Timeline", true); |
108 Runtime.experiments.register("colorContrastRatio", "Contrast ratio line in color picker", true); | 108 Runtime.experiments.register("colorContrastRatio", "Contrast ratio line in color picker", true); |
109 Runtime.experiments.register("cpuThrottling", "CPU throttling", true); | 109 Runtime.experiments.register("cpuThrottling", "CPU throttling", true); |
110 Runtime.experiments.register("deviceMode", "Device mode", true); | |
111 Runtime.experiments.register("emptySourceMapAutoStepping", "Empty source map auto-stepping"); | 110 Runtime.experiments.register("emptySourceMapAutoStepping", "Empty source map auto-stepping"); |
112 Runtime.experiments.register("fileSystemInspection", "FileSystem inspect ion"); | 111 Runtime.experiments.register("fileSystemInspection", "FileSystem inspect ion"); |
113 Runtime.experiments.register("gpuTimeline", "GPU data on timeline", true ); | 112 Runtime.experiments.register("gpuTimeline", "GPU data on timeline", true ); |
114 Runtime.experiments.register("inputEventsOnTimelineOverview", "Input eve nts on Timeline overview", true); | 113 Runtime.experiments.register("inputEventsOnTimelineOverview", "Input eve nts on Timeline overview", true); |
115 Runtime.experiments.register("layersPanel", "Layers panel"); | 114 Runtime.experiments.register("layersPanel", "Layers panel"); |
116 Runtime.experiments.register("layoutEditor", "Layout editor", true); | 115 Runtime.experiments.register("layoutEditor", "Layout editor", true); |
117 Runtime.experiments.register("materialDesign", "Material design"); | 116 Runtime.experiments.register("materialDesign", "Material design"); |
118 Runtime.experiments.register("multipleTimelineViews", "Multiple main vie ws on Timeline", true); | 117 Runtime.experiments.register("multipleTimelineViews", "Multiple main vie ws on Timeline", true); |
119 Runtime.experiments.register("networkRequestHeadersFilterInDetailsView", "Network request headers filter in details view", true); | 118 Runtime.experiments.register("networkRequestHeadersFilterInDetailsView", "Network request headers filter in details view", true); |
120 Runtime.experiments.register("networkRequestsOnTimeline", "Network reque sts on Timeline", true); | 119 Runtime.experiments.register("networkRequestsOnTimeline", "Network reque sts on Timeline", true); |
(...skipping 19 matching lines...) Expand all Loading... | |
140 Runtime.experiments.enableForTest("promiseTracker"); | 139 Runtime.experiments.enableForTest("promiseTracker"); |
141 if (testPath.indexOf("layers/") !== -1) | 140 if (testPath.indexOf("layers/") !== -1) |
142 Runtime.experiments.enableForTest("layersPanel"); | 141 Runtime.experiments.enableForTest("layersPanel"); |
143 if (testPath.indexOf("timeline/") !== -1 || testPath.indexOf("layers /") !== -1) | 142 if (testPath.indexOf("timeline/") !== -1 || testPath.indexOf("layers /") !== -1) |
144 Runtime.experiments.enableForTest("layersPanel"); | 143 Runtime.experiments.enableForTest("layersPanel"); |
145 if (testPath.indexOf("security/") !== -1) | 144 if (testPath.indexOf("security/") !== -1) |
146 Runtime.experiments.enableForTest("securityPanel"); | 145 Runtime.experiments.enableForTest("securityPanel"); |
147 } | 146 } |
148 | 147 |
149 Runtime.experiments.setDefaultExperiments([ | 148 Runtime.experiments.setDefaultExperiments([ |
150 "deviceMode", | |
151 "securityPanel" | 149 "securityPanel" |
152 ]); | 150 ]); |
153 }, | 151 }, |
154 | 152 |
155 /** | 153 /** |
156 * @suppressGlobalPropertiesCheck | 154 * @suppressGlobalPropertiesCheck |
157 */ | 155 */ |
158 _createAppUI: function() | 156 _createAppUI: function() |
159 { | 157 { |
160 console.timeStamp("Main._createApp"); | 158 console.timeStamp("Main._createApp"); |
(...skipping 10 matching lines...) Expand all Loading... | |
171 | 169 |
172 this._addMainEventListeners(document); | 170 this._addMainEventListeners(document); |
173 | 171 |
174 var canDock = !!Runtime.queryParam("can_dock"); | 172 var canDock = !!Runtime.queryParam("can_dock"); |
175 WebInspector.zoomManager = new WebInspector.ZoomManager(window, Inspecto rFrontendHost); | 173 WebInspector.zoomManager = new WebInspector.ZoomManager(window, Inspecto rFrontendHost); |
176 WebInspector.inspectorView = new WebInspector.InspectorView(); | 174 WebInspector.inspectorView = new WebInspector.InspectorView(); |
177 WebInspector.ContextMenu.initialize(); | 175 WebInspector.ContextMenu.initialize(); |
178 WebInspector.ContextMenu.installHandler(document); | 176 WebInspector.ContextMenu.installHandler(document); |
179 WebInspector.Tooltip.installHandler(document); | 177 WebInspector.Tooltip.installHandler(document); |
180 WebInspector.dockController = new WebInspector.DockController(canDock); | 178 WebInspector.dockController = new WebInspector.DockController(canDock); |
181 WebInspector.overridesSupport = new WebInspector.OverridesSupport(); | |
182 WebInspector.emulatedDevicesList = new WebInspector.EmulatedDevicesList( ); | 179 WebInspector.emulatedDevicesList = new WebInspector.EmulatedDevicesList( ); |
183 WebInspector.multitargetConsoleModel = new WebInspector.MultitargetConso leModel(); | 180 WebInspector.multitargetConsoleModel = new WebInspector.MultitargetConso leModel(); |
184 WebInspector.multitargetNetworkManager = new WebInspector.MultitargetNet workManager(); | 181 WebInspector.multitargetNetworkManager = new WebInspector.MultitargetNet workManager(); |
185 | 182 |
186 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); | 183 WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); |
187 // set order of some sections explicitly | 184 // set order of some sections explicitly |
188 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Pan el")); | 185 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Pan el")); |
189 WebInspector.shortcutsScreen.section(WebInspector.UIString("Styles Pane" )); | 186 WebInspector.shortcutsScreen.section(WebInspector.UIString("Styles Pane" )); |
190 WebInspector.shortcutsScreen.section(WebInspector.UIString("Debugger")); | 187 WebInspector.shortcutsScreen.section(WebInspector.UIString("Debugger")); |
191 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console")); | 188 WebInspector.shortcutsScreen.section(WebInspector.UIString("Console")); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 * @param {!WebInspector.Event} event | 303 * @param {!WebInspector.Event} event |
307 */ | 304 */ |
308 function onDisconnected(event) | 305 function onDisconnected(event) |
309 { | 306 { |
310 if (WebInspector._disconnectedScreenWithReasonWasShown) | 307 if (WebInspector._disconnectedScreenWithReasonWasShown) |
311 return; | 308 return; |
312 WebInspector.RemoteDebuggingTerminatedScreen.show(event.data.reason) ; | 309 WebInspector.RemoteDebuggingTerminatedScreen.show(event.data.reason) ; |
313 } | 310 } |
314 | 311 |
315 var targetType = Runtime.queryParam("isSharedWorker") ? WebInspector.Tar get.Type.ServiceWorker : WebInspector.Target.Type.Page; | 312 var targetType = Runtime.queryParam("isSharedWorker") ? WebInspector.Tar get.Type.ServiceWorker : WebInspector.Target.Type.Page; |
316 | |
317 this._mainTarget = WebInspector.targetManager.createTarget(WebInspector. UIString("Main"), targetType, connection, null); | 313 this._mainTarget = WebInspector.targetManager.createTarget(WebInspector. UIString("Main"), targetType, connection, null); |
318 console.timeStamp("Main._mainTargetCreated"); | 314 console.timeStamp("Main._mainTargetCreated"); |
319 this._registerShortcuts(); | 315 this._registerShortcuts(); |
320 var main = this; | |
321 | 316 |
322 this._mainTarget.registerInspectorDispatcher(this); | 317 this._mainTarget.registerInspectorDispatcher(this); |
323 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.E vents.ReloadInspectedPage, this._reloadInspectedPage, this); | 318 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.E vents.ReloadInspectedPage, this._reloadInspectedPage, this); |
324 | 319 |
325 if (this._mainTarget.isServiceWorker()) | 320 if (this._mainTarget.isServiceWorker()) |
326 this._mainTarget.runtimeAgent().run(); | 321 this._mainTarget.runtimeAgent().run(); |
327 | 322 |
328 if (this._appUIPresented) | 323 if (this._appUIPresented) |
329 this._initOverrides(); | 324 this._loadingDone(); |
330 }, | 325 }, |
331 | 326 |
332 _didPresentAppUI: function() | 327 _didPresentAppUI: function() |
333 { | 328 { |
334 this._appUIPresented = true; | 329 this._appUIPresented = true; |
335 if (this._mainTarget) | 330 if (this._mainTarget) |
336 this._initOverrides(); | 331 this._loadingDone(); |
337 }, | 332 }, |
338 | 333 |
339 _initOverrides: function() | 334 _loadingDone: function() |
340 { | 335 { |
341 WebInspector.overridesSupport.init(this._mainTarget, this._overridesRead y.bind(this)); | |
342 }, | |
343 | |
344 _overridesReady: function() | |
345 { | |
346 if (!WebInspector.dockController.canDock() && WebInspector.overridesSupp ort.emulationEnabled()) | |
347 WebInspector.inspectorView.showViewInDrawer("emulation", true); | |
jochen (gone - plz use gerrit)
2016/02/25 11:13:34
I suspect this broke the "disable javascript": set
| |
348 | |
349 this._mainTarget.inspectorAgent().enable(inspectorAgentEnableCallback); | 336 this._mainTarget.inspectorAgent().enable(inspectorAgentEnableCallback); |
350 | 337 |
351 function inspectorAgentEnableCallback() | 338 function inspectorAgentEnableCallback() |
352 { | 339 { |
353 console.timeStamp("Main.inspectorAgentEnableCallback"); | 340 console.timeStamp("Main.inspectorAgentEnableCallback"); |
354 WebInspector.notifications.dispatchEventToListeners(WebInspector.Not ificationService.Events.InspectorAgentEnabledForTests); | 341 WebInspector.notifications.dispatchEventToListeners(WebInspector.Not ificationService.Events.InspectorAgentEnabledForTests); |
355 // Asynchronously run the extensions. | 342 // Asynchronously run the extensions. |
356 setTimeout(lateInitialization, 0); | 343 setTimeout(lateInitialization, 0); |
357 } | 344 } |
358 | 345 |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1095 */ | 1082 */ |
1096 willHide: function() | 1083 willHide: function() |
1097 { | 1084 { |
1098 this._hideCallback.call(null); | 1085 this._hideCallback.call(null); |
1099 }, | 1086 }, |
1100 | 1087 |
1101 __proto__: WebInspector.VBox.prototype | 1088 __proto__: WebInspector.VBox.prototype |
1102 } | 1089 } |
1103 | 1090 |
1104 new WebInspector.Main(); | 1091 new WebInspector.Main(); |
OLD | NEW |