Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2356423002: [DevTools] Turn WebInspector.Panel into a web component.
Patch Set: partial fixes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 18 matching lines...) Expand all
29 * @extends {WebInspector.Panel} 29 * @extends {WebInspector.Panel}
30 * @implements {WebInspector.ContextMenu.Provider} 30 * @implements {WebInspector.ContextMenu.Provider}
31 * @implements {WebInspector.TargetManager.Observer} 31 * @implements {WebInspector.TargetManager.Observer}
32 * @implements {WebInspector.ViewLocationResolver} 32 * @implements {WebInspector.ViewLocationResolver}
33 */ 33 */
34 WebInspector.SourcesPanel = function() 34 WebInspector.SourcesPanel = function()
35 { 35 {
36 WebInspector.Panel.call(this, "sources"); 36 WebInspector.Panel.call(this, "sources");
37 WebInspector.SourcesPanel._instance = this; 37 WebInspector.SourcesPanel._instance = this;
38 this.registerRequiredCSS("sources/sourcesPanel.css"); 38 this.registerRequiredCSS("sources/sourcesPanel.css");
39 new WebInspector.DropTarget(this.element, [WebInspector.DropTarget.Types.Fil es], WebInspector.UIString("Drop workspace folder here"), this._handleDrop.bind( this)); 39 new WebInspector.DropTarget(this.contentElement, [WebInspector.DropTarget.Ty pes.Files], WebInspector.UIString("Drop workspace folder here"), this._handleDro p.bind(this));
40 40
41 this._workspace = WebInspector.workspace; 41 this._workspace = WebInspector.workspace;
42 this._networkMapping = WebInspector.networkMapping; 42 this._networkMapping = WebInspector.networkMapping;
43 43
44 this._runSnippetAction = /** @type {!WebInspector.Action }*/ (WebInspector.a ctionRegistry.action("debugger.run-snippet")); 44 this._runSnippetAction = /** @type {!WebInspector.Action }*/ (WebInspector.a ctionRegistry.action("debugger.run-snippet"));
45 this._togglePauseAction = /** @type {!WebInspector.Action }*/ (WebInspector. actionRegistry.action("debugger.toggle-pause")); 45 this._togglePauseAction = /** @type {!WebInspector.Action }*/ (WebInspector. actionRegistry.action("debugger.toggle-pause"));
46 this._stepOverAction = /** @type {!WebInspector.Action }*/ (WebInspector.act ionRegistry.action("debugger.step-over")); 46 this._stepOverAction = /** @type {!WebInspector.Action }*/ (WebInspector.act ionRegistry.action("debugger.step-over"));
47 this._stepIntoAction = /** @type {!WebInspector.Action }*/ (WebInspector.act ionRegistry.action("debugger.step-into")); 47 this._stepIntoAction = /** @type {!WebInspector.Action }*/ (WebInspector.act ionRegistry.action("debugger.step-into"));
48 this._stepOutAction = /** @type {!WebInspector.Action }*/ (WebInspector.acti onRegistry.action("debugger.step-out")); 48 this._stepOutAction = /** @type {!WebInspector.Action }*/ (WebInspector.acti onRegistry.action("debugger.step-out"));
49 this._toggleBreakpointsActiveAction = /** @type {!WebInspector.Action }*/ (W ebInspector.actionRegistry.action("debugger.toggle-breakpoints-active")); 49 this._toggleBreakpointsActiveAction = /** @type {!WebInspector.Action }*/ (W ebInspector.actionRegistry.action("debugger.toggle-breakpoints-active"));
50 50
51 this._debugToolbar = this._createDebugToolbar(); 51 this._debugToolbar = this._createDebugToolbar();
52 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); 52 this._debugToolbarDrawer = this._createDebugToolbarDrawer();
53 53
54 const initialDebugSidebarWidth = 225; 54 const initialDebugSidebarWidth = 225;
55 this._splitWidget = new WebInspector.SplitWidget(true, true, "sourcesPanelSp litViewState", initialDebugSidebarWidth); 55 this._splitWidget = new WebInspector.SplitWidget(true, true, "sourcesPanelSp litViewState", initialDebugSidebarWidth);
56 this._splitWidget.enableShowModeSaving(); 56 this._splitWidget.enableShowModeSaving();
57 this._splitWidget.show(this.element); 57 this._splitWidget.show(this.contentElement);
58 58
59 // Create scripts navigator 59 // Create scripts navigator
60 const initialNavigatorWidth = 225; 60 const initialNavigatorWidth = 225;
61 this.editorView = new WebInspector.SplitWidget(true, false, "sourcesPanelNav igatorSplitViewState", initialNavigatorWidth); 61 this.editorView = new WebInspector.SplitWidget(true, false, "sourcesPanelNav igatorSplitViewState", initialNavigatorWidth);
62 this.editorView.enableShowModeSaving(); 62 this.editorView.enableShowModeSaving();
63 this.editorView.element.tabIndex = 0; 63 this.editorView.element.tabIndex = 0;
64 this._splitWidget.setMainWidget(this.editorView); 64 this._splitWidget.setMainWidget(this.editorView);
65 65
66 // Create navigator tabbed pane with toolbar. 66 // Create navigator tabbed pane with toolbar.
67 this._navigatorTabbedLocation = WebInspector.viewManager.createTabbedLocatio n(this._revealNavigatorSidebar.bind(this), "navigator-view", true); 67 this._navigatorTabbedLocation = WebInspector.viewManager.createTabbedLocatio n(this._revealNavigatorSidebar.bind(this), "navigator-view", true);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 _ensureSourcesViewVisible: function() 221 _ensureSourcesViewVisible: function()
222 { 222 {
223 if (WebInspector.SourcesPanel.WrapperView.isShowing()) 223 if (WebInspector.SourcesPanel.WrapperView.isShowing())
224 return true; 224 return true;
225 return this === WebInspector.inspectorView.setCurrentPanel(this); 225 return this === WebInspector.inspectorView.setCurrentPanel(this);
226 }, 226 },
227 227
228 onResize: function() 228 onResize: function()
229 { 229 {
230 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") 230 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto")
231 this.element.window().requestAnimationFrame(this._updateSidebarPosit ion.bind(this)); // Do not force layout. 231 this.contentElement.window().requestAnimationFrame(this._updateSideb arPosition.bind(this)); // Do not force layout.
232 }, 232 },
233 233
234 /** 234 /**
235 * @override 235 * @override
236 * @return {!WebInspector.SearchableView} 236 * @return {!WebInspector.SearchableView}
237 */ 237 */
238 searchableView: function() 238 searchableView: function()
239 { 239 {
240 return this._sourcesView.searchableView(); 240 return this._sourcesView.searchableView();
241 }, 241 },
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 __proto__: WebInspector.VBox.prototype 1361 __proto__: WebInspector.VBox.prototype
1362 } 1362 }
1363 1363
1364 /** 1364 /**
1365 * @return {boolean} 1365 * @return {boolean}
1366 */ 1366 */
1367 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1367 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1368 { 1368 {
1369 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1369 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1370 } 1370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698