Chromium Code Reviews| 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 Runtime.experiments.register('colorContrastRatio', 'Contrast ratio line in c olor picker', true); | 100 Runtime.experiments.register('colorContrastRatio', 'Contrast ratio line in c olor picker', true); |
| 101 Runtime.experiments.register('continueToFirstInvocation', 'Continue to first invocation', true); | 101 Runtime.experiments.register('continueToFirstInvocation', 'Continue to first invocation', true); |
| 102 Runtime.experiments.register('cssTrackerPanel', 'Panel that tracks the usage of CSS rules.'); | 102 Runtime.experiments.register('cssTrackerPanel', 'Panel that tracks the usage of CSS rules.'); |
| 103 Runtime.experiments.register('emptySourceMapAutoStepping', 'Empty sourcemap auto-stepping'); | 103 Runtime.experiments.register('emptySourceMapAutoStepping', 'Empty sourcemap auto-stepping'); |
| 104 Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true); | 104 Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true); |
| 105 Runtime.experiments.register('liveSASS', 'Live SASS'); | 105 Runtime.experiments.register('liveSASS', 'Live SASS'); |
| 106 Runtime.experiments.register('networkGroupingRequests', 'Network request gro ups support', true); | 106 Runtime.experiments.register('networkGroupingRequests', 'Network request gro ups support', true); |
| 107 Runtime.experiments.register('objectPreviews', 'Object previews', true); | 107 Runtime.experiments.register('objectPreviews', 'Object previews', true); |
| 108 Runtime.experiments.register('persistence2', 'Persistence 2.0'); | 108 Runtime.experiments.register('persistence2', 'Persistence 2.0'); |
| 109 Runtime.experiments.register('persistenceValidation', 'Validate persistence bindings'); | 109 Runtime.experiments.register('persistenceValidation', 'Validate persistence bindings'); |
| 110 Runtime.experiments.register('releaseNote', 'Release note', true); | |
| 110 Runtime.experiments.register('requestBlocking', 'Request blocking', true); | 111 Runtime.experiments.register('requestBlocking', 'Request blocking', true); |
| 111 Runtime.experiments.register('timelineShowAllEvents', 'Show all events on Ti meline', true); | 112 Runtime.experiments.register('timelineShowAllEvents', 'Show all events on Ti meline', true); |
| 112 Runtime.experiments.register('timelineShowAllProcesses', 'Show all processes on Timeline', true); | 113 Runtime.experiments.register('timelineShowAllProcesses', 'Show all processes on Timeline', true); |
| 113 Runtime.experiments.register('timelinePaintTimingMarkers', 'Show paint timin g markers on Timeline', true); | 114 Runtime.experiments.register('timelinePaintTimingMarkers', 'Show paint timin g markers on Timeline', true); |
| 114 Runtime.experiments.register('sourceDiff', 'Source diff'); | 115 Runtime.experiments.register('sourceDiff', 'Source diff'); |
| 115 Runtime.experiments.register('terminalInDrawer', 'Terminal in drawer', true) ; | 116 Runtime.experiments.register('terminalInDrawer', 'Terminal in drawer', true) ; |
| 116 Runtime.experiments.register('timelineInvalidationTracking', 'Timeline inval idation tracking', true); | 117 Runtime.experiments.register('timelineInvalidationTracking', 'Timeline inval idation tracking', true); |
| 117 Runtime.experiments.register('timelineMultipleMainViews', 'Timeline with mul tiple main views'); | 118 Runtime.experiments.register('timelineMultipleMainViews', 'Timeline with mul tiple main views'); |
| 118 Runtime.experiments.register('timelineTracingJSProfile', 'Timeline tracing b ased JS profiler', true); | 119 Runtime.experiments.register('timelineTracingJSProfile', 'Timeline tracing b ased JS profiler', true); |
| 119 Runtime.experiments.register('timelineV8RuntimeCallStats', 'V8 Runtime Call Stats on Timeline', true); | 120 Runtime.experiments.register('timelineV8RuntimeCallStats', 'V8 Runtime Call Stats on Timeline', true); |
| 120 Runtime.experiments.register('timelinePerFrameTrack', 'Show track per frame on Timeline', true); | 121 Runtime.experiments.register('timelinePerFrameTrack', 'Show track per frame on Timeline', true); |
| 121 | 122 |
| 122 Runtime.experiments.cleanUpStaleExperiments(); | 123 Runtime.experiments.cleanUpStaleExperiments(); |
| 123 | 124 |
| 124 if (Host.isUnderTest(prefs)) { | 125 if (Host.isUnderTest(prefs)) { |
| 125 var testPath = JSON.parse(prefs['testPath'] || '""'); | 126 var testPath = JSON.parse(prefs['testPath'] || '""'); |
| 126 // Enable experiments for testing. | 127 // Enable experiments for testing. |
| 127 if (testPath.indexOf('accessibility/') !== -1) | 128 if (testPath.indexOf('accessibility/') !== -1) |
| 128 Runtime.experiments.enableForTest('accessibilityInspection'); | 129 Runtime.experiments.enableForTest('accessibilityInspection'); |
| 129 if (testPath.indexOf('css_tracker') !== -1) | 130 if (testPath.indexOf('css_tracker') !== -1) |
| 130 Runtime.experiments.enableForTest('cssTrackerPanel'); | 131 Runtime.experiments.enableForTest('cssTrackerPanel'); |
| 131 if (testPath.indexOf('audits2/') !== -1) | 132 if (testPath.indexOf('audits2/') !== -1) |
| 132 Runtime.experiments.enableForTest('audits2'); | 133 Runtime.experiments.enableForTest('audits2'); |
| 134 if (testPath.indexOf('help/') !== -1) | |
| 135 Runtime.experiments.enableForTest('releaseNote'); | |
| 133 } | 136 } |
| 134 | 137 |
| 135 Runtime.experiments.setDefaultExperiments(['persistenceValidation', 'timelin eMultipleMainViews']); | 138 Runtime.experiments.setDefaultExperiments(['persistenceValidation', 'timelin eMultipleMainViews']); |
| 136 } | 139 } |
| 137 | 140 |
| 138 /** | 141 /** |
| 139 * @suppressGlobalPropertiesCheck | 142 * @suppressGlobalPropertiesCheck |
| 140 */ | 143 */ |
| 141 _createAppUI() { | 144 _createAppUI() { |
| 142 console.time('Main._createAppUI'); | 145 console.time('Main._createAppUI'); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 Workspace.fileSystemMapping = new Workspace.FileSystemMapping(Workspace.isol atedFileSystemManager); | 182 Workspace.fileSystemMapping = new Workspace.FileSystemMapping(Workspace.isol atedFileSystemManager); |
| 180 | 183 |
| 181 Main.networkProjectManager = new Bindings.NetworkProjectManager(SDK.targetMa nager, Workspace.workspace); | 184 Main.networkProjectManager = new Bindings.NetworkProjectManager(SDK.targetMa nager, Workspace.workspace); |
| 182 Bindings.presentationConsoleMessageHelper = new Bindings.PresentationConsole MessageHelper(Workspace.workspace); | 185 Bindings.presentationConsoleMessageHelper = new Bindings.PresentationConsole MessageHelper(Workspace.workspace); |
| 183 Bindings.cssWorkspaceBinding = new Bindings.CSSWorkspaceBinding(SDK.targetMa nager, Workspace.workspace); | 186 Bindings.cssWorkspaceBinding = new Bindings.CSSWorkspaceBinding(SDK.targetMa nager, Workspace.workspace); |
| 184 Bindings.debuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceBinding(SD K.targetManager, Workspace.workspace); | 187 Bindings.debuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceBinding(SD K.targetManager, Workspace.workspace); |
| 185 Bindings.breakpointManager = | 188 Bindings.breakpointManager = |
| 186 new Bindings.BreakpointManager(null, Workspace.workspace, SDK.targetMana ger, Bindings.debuggerWorkspaceBinding); | 189 new Bindings.BreakpointManager(null, Workspace.workspace, SDK.targetMana ger, Bindings.debuggerWorkspaceBinding); |
| 187 Extensions.extensionServer = new Extensions.ExtensionServer(); | 190 Extensions.extensionServer = new Extensions.ExtensionServer(); |
| 188 | 191 |
| 192 if (!Host.isUnderTest()) | |
| 193 Help.ReleaseNoteManager.init(); | |
| 194 | |
| 189 new Persistence.FileSystemWorkspaceBinding(Workspace.isolatedFileSystemManag er, Workspace.workspace); | 195 new Persistence.FileSystemWorkspaceBinding(Workspace.isolatedFileSystemManag er, Workspace.workspace); |
| 190 Persistence.persistence = | 196 Persistence.persistence = |
| 191 new Persistence.Persistence(Workspace.workspace, Bindings.breakpointMana ger, Workspace.fileSystemMapping); | 197 new Persistence.Persistence(Workspace.workspace, Bindings.breakpointMana ger, Workspace.fileSystemMapping); |
| 192 | 198 |
| 193 new Main.OverlayController(); | 199 new Main.OverlayController(); |
| 194 new Main.ExecutionContextSelector(SDK.targetManager, UI.context); | 200 new Main.ExecutionContextSelector(SDK.targetManager, UI.context); |
| 195 Bindings.blackboxManager = new Bindings.BlackboxManager(Bindings.debuggerWor kspaceBinding); | 201 Bindings.blackboxManager = new Bindings.BlackboxManager(Bindings.debuggerWor kspaceBinding); |
| 196 | 202 |
| 197 new Main.Main.PauseListener(); | 203 new Main.Main.PauseListener(); |
| 198 new Main.Main.InspectedNodeRevealer(); | 204 new Main.Main.InspectedNodeRevealer(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 | 276 |
| 271 function webSocketConnectionLost() { | 277 function webSocketConnectionLost() { |
| 272 if (!Main._disconnectedScreenWithReasonWasShown) | 278 if (!Main._disconnectedScreenWithReasonWasShown) |
| 273 Main.RemoteDebuggingTerminatedScreen.show('WebSocket disconnected'); | 279 Main.RemoteDebuggingTerminatedScreen.show('WebSocket disconnected'); |
| 274 } | 280 } |
| 275 } | 281 } |
| 276 | 282 |
| 277 _lateInitialization() { | 283 _lateInitialization() { |
| 278 console.timeStamp('Main._lateInitialization'); | 284 console.timeStamp('Main._lateInitialization'); |
| 279 this._registerShortcuts(); | 285 this._registerShortcuts(); |
| 280 Extensions.extensionServer.initializeExtensions(); | 286 Extensions.extensionServer.initializeExtensions(); |
|
dgozman
2017/02/17 22:27:04
Move it here.
chenwilliam
2017/02/17 23:23:49
Done.
| |
| 281 } | 287 } |
| 282 | 288 |
| 283 _registerForwardedShortcuts() { | 289 _registerForwardedShortcuts() { |
| 284 /** @const */ var forwardedActions = | 290 /** @const */ var forwardedActions = |
| 285 ['main.toggle-dock', 'debugger.toggle-breakpoints-active', 'debugger.tog gle-pause', 'commandMenu.show']; | 291 ['main.toggle-dock', 'debugger.toggle-breakpoints-active', 'debugger.tog gle-pause', 'commandMenu.show']; |
| 286 var actionKeys = | 292 var actionKeys = |
| 287 UI.shortcutRegistry.keysForActions(forwardedActions).map(UI.KeyboardShor tcut.keyCodeAndModifiersFromKey); | 293 UI.shortcutRegistry.keysForActions(forwardedActions).map(UI.KeyboardShor tcut.keyCodeAndModifiersFromKey); |
| 288 InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)); | 294 InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)); |
| 289 } | 295 } |
| 290 | 296 |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 976 * @override | 982 * @override |
| 977 * @return {?Element} | 983 * @return {?Element} |
| 978 */ | 984 */ |
| 979 settingElement() { | 985 settingElement() { |
| 980 return UI.SettingsUI.createSettingCheckbox( | 986 return UI.SettingsUI.createSettingCheckbox( |
| 981 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); | 987 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); |
| 982 } | 988 } |
| 983 }; | 989 }; |
| 984 | 990 |
| 985 new Main.Main(); | 991 new Main.Main(); |
| OLD | NEW |