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

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

Issue 2466013002: DevTools: [Workspace] show dirty asterisk in file tab title. (Closed)
Patch Set: Created 4 years, 1 month 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) 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 }; 300 };
301 this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events. EditorSelected, eventData); 301 this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events. EditorSelected, eventData);
302 }, 302 },
303 303
304 /** 304 /**
305 * @param {!WebInspector.UISourceCode} uiSourceCode 305 * @param {!WebInspector.UISourceCode} uiSourceCode
306 * @return {string} 306 * @return {string}
307 */ 307 */
308 _titleForFile: function(uiSourceCode) 308 _titleForFile: function(uiSourceCode)
309 { 309 {
310 uiSourceCode = WebInspector.persistence.fileSystem(uiSourceCode) || uiSo urceCode; 310 var binding = WebInspector.persistence.binding(uiSourceCode);
311 var titleUISourceCode = binding ? binding.fileSystem : uiSourceCode;
311 var maxDisplayNameLength = 30; 312 var maxDisplayNameLength = 30;
312 var title = uiSourceCode.displayName(true).trimMiddle(maxDisplayNameLeng th); 313 var title = titleUISourceCode.displayName(true).trimMiddle(maxDisplayNam eLength);
313 if (uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommitt edChanges(uiSourceCode)) 314 if (uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommitt edChanges(uiSourceCode))
314 title += "*"; 315 title += "*";
315 return title; 316 return title;
316 }, 317 },
317 318
318 /** 319 /**
319 * @param {string} id 320 * @param {string} id
320 * @param {string} nextTabId 321 * @param {string} nextTabId
321 */ 322 */
322 _maybeCloseTab: function(id, nextTabId) 323 _maybeCloseTab: function(id, nextTabId)
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 /** 840 /**
840 * @override 841 * @override
841 * @param {string} tabId 842 * @param {string} tabId
842 * @param {!WebInspector.ContextMenu} contextMenu 843 * @param {!WebInspector.ContextMenu} contextMenu
843 */ 844 */
844 onContextMenu: function(tabId, contextMenu) 845 onContextMenu: function(tabId, contextMenu)
845 { 846 {
846 this._editorContainer._onContextMenu(tabId, contextMenu); 847 this._editorContainer._onContextMenu(tabId, contextMenu);
847 } 848 }
848 } 849 }
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