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

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

Issue 2536273003: [DevTools] Remove Workspace.projectTypes enum part1. (Closed)
Patch Set: Created 4 years 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 this._appendFileTab(uiSourceCode, false); 372 this._appendFileTab(uiSourceCode, false);
373 373
374 // Select tab if this file was the last to be shown. 374 // Select tab if this file was the last to be shown.
375 if (!index) { 375 if (!index) {
376 this._innerShowFile(uiSourceCode, false); 376 this._innerShowFile(uiSourceCode, false);
377 return; 377 return;
378 } 378 }
379 379
380 if (!this._currentFile) 380 if (!this._currentFile)
381 return; 381 return;
382 var currentProjectType = this._currentFile.project().type(); 382 var currentIsSnippet = Snippets.ScriptSnippetModel.isSnippetUISourceCode(thi s._currentFile);
383 var addedProjectType = uiSourceCode.project().type(); 383 var addedIsSnippet = Snippets.ScriptSnippetModel.isSnippetUISourceCode(uiSou rceCode);
384 var snippetsProjectType = Workspace.projectTypes.Snippets; 384 if (this._history.index(this._currentFile.url()) && currentIsSnippet && !add edIsSnippet)
385 if (this._history.index(this._currentFile.url()) && currentProjectType === s nippetsProjectType &&
386 addedProjectType !== snippetsProjectType)
387 this._innerShowFile(uiSourceCode, false); 385 this._innerShowFile(uiSourceCode, false);
388 } 386 }
389 387
390 /** 388 /**
391 * @param {!Workspace.UISourceCode} uiSourceCode 389 * @param {!Workspace.UISourceCode} uiSourceCode
392 */ 390 */
393 removeUISourceCode(uiSourceCode) { 391 removeUISourceCode(uiSourceCode) {
394 this.removeUISourceCodes([uiSourceCode]); 392 this.removeUISourceCodes([uiSourceCode]);
395 } 393 }
396 394
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 818
821 /** 819 /**
822 * @override 820 * @override
823 * @param {string} tabId 821 * @param {string} tabId
824 * @param {!UI.ContextMenu} contextMenu 822 * @param {!UI.ContextMenu} contextMenu
825 */ 823 */
826 onContextMenu(tabId, contextMenu) { 824 onContextMenu(tabId, contextMenu) {
827 this._editorContainer._onContextMenu(tabId, contextMenu); 825 this._editorContainer._onContextMenu(tabId, contextMenu);
828 } 826 }
829 }; 827 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698