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

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

Issue 2376123002: [DevTools] Remove sidebar buttons from Quick Source. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 tabbedPane.element.classList.add("navigator-tabbed-pane"); 71 tabbedPane.element.classList.add("navigator-tabbed-pane");
72 var navigatorMenuButton = new WebInspector.ToolbarMenuButton(this._populateN avigatorMenu.bind(this), true); 72 var navigatorMenuButton = new WebInspector.ToolbarMenuButton(this._populateN avigatorMenu.bind(this), true);
73 navigatorMenuButton.setTitle(WebInspector.UIString("More options")); 73 navigatorMenuButton.setTitle(WebInspector.UIString("More options"));
74 tabbedPane.rightToolbar().appendToolbarItem(navigatorMenuButton); 74 tabbedPane.rightToolbar().appendToolbarItem(navigatorMenuButton);
75 this.editorView.setSidebarWidget(tabbedPane); 75 this.editorView.setSidebarWidget(tabbedPane);
76 76
77 this._sourcesView = new WebInspector.SourcesView(); 77 this._sourcesView = new WebInspector.SourcesView();
78 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel ected, this._editorSelected.bind(this)); 78 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel ected, this._editorSelected.bind(this));
79 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo sed, this._editorClosed.bind(this)); 79 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo sed, this._editorClosed.bind(this));
80 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); 80 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this));
81 this.editorView.setMainWidget(this._sourcesView); 81
82 this._toggleNavigatorSidebarButton = this.editorView.createShowHideSidebarBu tton("navigator");
83 this._toggleDebuggerSidebarButton = this._splitWidget.createShowHideSidebarB utton("debugger");
84 this._showSourcesViewInPanel();
lushnikov 2016/09/28 21:22:49 you don't need this call
dgozman 2016/09/28 23:06:50 I am worried something below depends on SourcesVie
82 this._editorChanged(this._sourcesView.currentUISourceCode()); 85 this._editorChanged(this._sourcesView.currentUISourceCode());
83 86
84 this._threadsSidebarPane = null; 87 this._threadsSidebarPane = null;
85 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie wManager.view("sources.watch")); 88 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie wManager.view("sources.watch"));
86 // TODO: Force installing listeners from the model, not the UI. 89 // TODO: Force installing listeners from the model, not the UI.
87 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); 90 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane);
88 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide barPane); 91 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide barPane);
89 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this)); 92 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this));
90 93
91 this._sourcesView.leftToolbar().appendToolbarItem(this.editorView.createShow HideSidebarButton("navigator"));
92 this._toggleDebuggerSidebarButton = this._splitWidget.createShowHideSidebarB utton("debugger");
93 this._sourcesView.rightToolbar().appendToolbarItem(this._toggleDebuggerSideb arButton);
94
95 WebInspector.moduleSetting("sidebarPosition").addChangeListener(this._update SidebarPosition.bind(this)); 94 WebInspector.moduleSetting("sidebarPosition").addChangeListener(this._update SidebarPosition.bind(this));
96 this._updateSidebarPosition(); 95 this._updateSidebarPosition();
97 96
98 this._updateDebuggerButtons(); 97 this._updateDebuggerButtons();
99 this._pauseOnExceptionEnabledChanged(); 98 this._pauseOnExceptionEnabledChanged();
100 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this ._pauseOnExceptionEnabledChanged, this); 99 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this ._pauseOnExceptionEnabledChanged, this);
101 100
102 this._liveLocationPool = new WebInspector.LiveLocationPool(); 101 this._liveLocationPool = new WebInspector.LiveLocationPool();
103 102
104 this._setTarget(WebInspector.context.flavor(WebInspector.Target)); 103 this._setTarget(WebInspector.context.flavor(WebInspector.Target));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 180
182 wasShown: function() 181 wasShown: function()
183 { 182 {
184 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); 183 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
185 WebInspector.Panel.prototype.wasShown.call(this); 184 WebInspector.Panel.prototype.wasShown.call(this);
186 var wrapper = WebInspector.SourcesPanel.WrapperView._instance; 185 var wrapper = WebInspector.SourcesPanel.WrapperView._instance;
187 if (wrapper && wrapper.isShowing()) { 186 if (wrapper && wrapper.isShowing()) {
188 WebInspector.inspectorView.setDrawerMinimized(true); 187 WebInspector.inspectorView.setDrawerMinimized(true);
189 WebInspector.SourcesPanel.updateResizer(this); 188 WebInspector.SourcesPanel.updateResizer(this);
190 } 189 }
191 this.editorView.setMainWidget(this._sourcesView); 190 this._showSourcesViewInPanel();
192 }, 191 },
193 192
194 willHide: function() 193 willHide: function()
195 { 194 {
196 WebInspector.Panel.prototype.willHide.call(this); 195 WebInspector.Panel.prototype.willHide.call(this);
197 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); 196 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
198 if (WebInspector.SourcesPanel.WrapperView.isShowing()) { 197 if (WebInspector.SourcesPanel.WrapperView.isShowing()) {
199 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ; 198 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ;
200 WebInspector.inspectorView.setDrawerMinimized(false); 199 WebInspector.inspectorView.setDrawerMinimized(false);
201 WebInspector.SourcesPanel.updateResizer(this); 200 WebInspector.SourcesPanel.updateResizer(this);
202 } 201 }
203 }, 202 },
204 203
204 _showSourcesViewInPanel: function()
205 {
206 this._sourcesView.leftToolbar().removeToolbarItems();
207 this._sourcesView.leftToolbar().appendToolbarItem(this._toggleNavigatorS idebarButton);
208 this._sourcesView.rightToolbar().removeToolbarItems();
209 this._sourcesView.rightToolbar().appendToolbarItem(this._toggleDebuggerS idebarButton);
210 this.editorView.setMainWidget(this._sourcesView);
211 },
212
205 /** 213 /**
206 * @override 214 * @override
207 * @param {string} locationName 215 * @param {string} locationName
208 * @return {?WebInspector.ViewLocation} 216 * @return {?WebInspector.ViewLocation}
209 */ 217 */
210 resolveLocation: function(locationName) 218 resolveLocation: function(locationName)
211 { 219 {
212 if (locationName === "sources-sidebar") 220 if (locationName === "sources-sidebar")
213 return this._sidebarPaneStack; 221 return this._sidebarPaneStack;
214 else 222 else
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 }, 1356 },
1349 1357
1350 willHide: function() 1358 willHide: function()
1351 { 1359 {
1352 WebInspector.inspectorView.setDrawerMinimized(false); 1360 WebInspector.inspectorView.setDrawerMinimized(false);
1353 setImmediate(() => WebInspector.SourcesPanel.updateResizer(WebInspector. SourcesPanel.instance())); 1361 setImmediate(() => WebInspector.SourcesPanel.updateResizer(WebInspector. SourcesPanel.instance()));
1354 }, 1362 },
1355 1363
1356 _showViewInWrapper: function() 1364 _showViewInWrapper: function()
1357 { 1365 {
1366 this._view.leftToolbar().removeToolbarItems();
1367 this._view.rightToolbar().removeToolbarItems();
1358 this._view.show(this.element); 1368 this._view.show(this.element);
1359 }, 1369 },
1360 1370
1361 __proto__: WebInspector.VBox.prototype 1371 __proto__: WebInspector.VBox.prototype
1362 } 1372 }
1363 1373
1364 /** 1374 /**
1365 * @return {boolean} 1375 * @return {boolean}
1366 */ 1376 */
1367 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1377 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1368 { 1378 {
1369 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1379 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1370 } 1380 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698