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

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

Issue 2390333002: DevTools: fix tabbed editor to not open all bound files (Closed)
Patch Set: nit 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) 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 WebInspector.TabbedEditorContainer.prototype = { 84 WebInspector.TabbedEditorContainer.prototype = {
85 /** 85 /**
86 * @param {!WebInspector.Event} event 86 * @param {!WebInspector.Event} event
87 */ 87 */
88 _onBindingCreated: function(event) 88 _onBindingCreated: function(event)
89 { 89 {
90 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data ); 90 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data );
91 var networkTabId = this._tabIds.get(binding.network); 91 var networkTabId = this._tabIds.get(binding.network);
92 var fileSystemTabId = this._tabIds.get(binding.fileSystem); 92 var fileSystemTabId = this._tabIds.get(binding.fileSystem);
93
94 if (networkTabId)
95 this._tabbedPane.changeTabTitle(networkTabId, this._titleForFile(bin ding.fileSystem), this._tooltipForFile(binding.fileSystem));
96 if (!fileSystemTabId)
97 return;
93 var wasSelectedInFileSystem = this._currentFile === binding.fileSystem; 98 var wasSelectedInFileSystem = this._currentFile === binding.fileSystem;
94 99 var tabIndex = this._tabbedPane.tabIndex(fileSystemTabId);
95 if (fileSystemTabId) { 100 this._closeTabs([fileSystemTabId]);
96 var tabIndex = this._tabbedPane.tabIndex(fileSystemTabId); 101 if (!networkTabId)
97 this._closeTabs([fileSystemTabId]); 102 networkTabId = this._appendFileTab(binding.network, false, tabIndex) ;
98 }
99
100 if (networkTabId) {
101 if (wasSelectedInFileSystem)
102 this._tabbedPane.selectTab(networkTabId, false);
103 this._tabbedPane.changeTabTitle(networkTabId, this._titleForFile(bin ding.fileSystem), this._tooltipForFile(binding.fileSystem));
104 return;
105 }
106
107 var tabId = this._appendFileTab(binding.network, false, tabIndex);
108 if (wasSelectedInFileSystem) 103 if (wasSelectedInFileSystem)
109 this._tabbedPane.selectTab(tabId, false); 104 this._tabbedPane.selectTab(networkTabId, false);
110 }, 105 },
111 106
112 /** 107 /**
113 * @param {!WebInspector.Event} event 108 * @param {!WebInspector.Event} event
114 */ 109 */
115 _onBindingRemoved: function(event) 110 _onBindingRemoved: function(event)
116 { 111 {
117 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data ); 112 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data );
118 var networkTabId = this._tabIds.get(binding.network); 113 var networkTabId = this._tabIds.get(binding.network);
119 if (!networkTabId) 114 if (!networkTabId)
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 /** 804 /**
810 * @override 805 * @override
811 * @param {string} tabId 806 * @param {string} tabId
812 * @param {!WebInspector.ContextMenu} contextMenu 807 * @param {!WebInspector.ContextMenu} contextMenu
813 */ 808 */
814 onContextMenu: function(tabId, contextMenu) 809 onContextMenu: function(tabId, contextMenu)
815 { 810 {
816 this._editorContainer._onContextMenu(tabId, contextMenu); 811 this._editorContainer._onContextMenu(tabId, contextMenu);
817 } 812 }
818 } 813 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-opens-network-uisourcecode-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698