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

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

Issue 2238003002: DevTools: migrate sources panel sidebar to views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 4 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
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 * 10 *
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 this._currentFile = uiSourceCode; 207 this._currentFile = uiSourceCode;
208 208
209 var tabId = this._tabIds.get(uiSourceCode) || this._appendFileTab(uiSour ceCode, userGesture); 209 var tabId = this._tabIds.get(uiSourceCode) || this._appendFileTab(uiSour ceCode, userGesture);
210 210
211 this._tabbedPane.selectTab(tabId, userGesture); 211 this._tabbedPane.selectTab(tabId, userGesture);
212 if (userGesture) 212 if (userGesture)
213 this._editorSelectedByUserAction(); 213 this._editorSelectedByUserAction();
214 214
215 var previousView = this._currentView; 215 var previousView = this._currentView;
216 this._currentView = this.visibleView; 216 this._currentView = this.visibleView;
217 WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, this._cur rentView instanceof WebInspector.UISourceCodeFrame ? this._currentView : null);
217 this._addViewListeners(); 218 this._addViewListeners();
218 219
219 var eventData = { 220 var eventData = {
220 currentFile: this._currentFile, 221 currentFile: this._currentFile,
221 currentView: this._currentView, 222 currentView: this._currentView,
222 previousView: previousView, 223 previousView: previousView,
223 userGesture: userGesture 224 userGesture: userGesture
224 }; 225 };
225 this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events. EditorSelected, eventData); 226 this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events. EditorSelected, eventData);
226 }, 227 },
(...skipping 15 matching lines...) Expand all
242 * @param {string} id 243 * @param {string} id
243 * @param {string} nextTabId 244 * @param {string} nextTabId
244 */ 245 */
245 _maybeCloseTab: function(id, nextTabId) 246 _maybeCloseTab: function(id, nextTabId)
246 { 247 {
247 var uiSourceCode = this._files[id]; 248 var uiSourceCode = this._files[id];
248 var shouldPrompt = uiSourceCode.isDirty() && uiSourceCode.project().canS etFileContent(); 249 var shouldPrompt = uiSourceCode.isDirty() && uiSourceCode.project().canS etFileContent();
249 // FIXME: this should be replaced with common Save/Discard/Cancel dialog . 250 // FIXME: this should be replaced with common Save/Discard/Cancel dialog .
250 if (!shouldPrompt || confirm(WebInspector.UIString("Are you sure you wan t to close unsaved file: %s?", uiSourceCode.name()))) { 251 if (!shouldPrompt || confirm(WebInspector.UIString("Are you sure you wan t to close unsaved file: %s?", uiSourceCode.name()))) {
251 uiSourceCode.resetWorkingCopy(); 252 uiSourceCode.resetWorkingCopy();
253 var previousView = this._currentView;
252 if (nextTabId) 254 if (nextTabId)
253 this._tabbedPane.selectTab(nextTabId, true); 255 this._tabbedPane.selectTab(nextTabId, true);
254 this._tabbedPane.closeTab(id, true); 256 this._tabbedPane.closeTab(id, true);
257 if (WebInspector.context.flavor(WebInspector.UISourceCodeFrame) === previousView)
258 WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, n ull);
255 return true; 259 return true;
256 } 260 }
257 return false; 261 return false;
258 }, 262 },
259 263
260 /** 264 /**
261 * @param {!Array.<string>} ids 265 * @param {!Array.<string>} ids
262 */ 266 */
263 _closeTabs: function(ids) 267 _closeTabs: function(ids)
264 { 268 {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 /** 750 /**
747 * @override 751 * @override
748 * @param {string} tabId 752 * @param {string} tabId
749 * @param {!WebInspector.ContextMenu} contextMenu 753 * @param {!WebInspector.ContextMenu} contextMenu
750 */ 754 */
751 onContextMenu: function(tabId, contextMenu) 755 onContextMenu: function(tabId, contextMenu)
752 { 756 {
753 this._editorContainer._onContextMenu(tabId, contextMenu); 757 this._editorContainer._onContextMenu(tabId, contextMenu);
754 } 758 }
755 } 759 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698