OLD | NEW |
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 } | 526 } |
527 | 527 |
528 /** | 528 /** |
529 * @param {!Workspace.UISourceCode} uiSourceCode | 529 * @param {!Workspace.UISourceCode} uiSourceCode |
530 */ | 530 */ |
531 _updateFileTitle(uiSourceCode) { | 531 _updateFileTitle(uiSourceCode) { |
532 var tabId = this._tabIds.get(uiSourceCode); | 532 var tabId = this._tabIds.get(uiSourceCode); |
533 if (tabId) { | 533 if (tabId) { |
534 var title = this._titleForFile(uiSourceCode); | 534 var title = this._titleForFile(uiSourceCode); |
535 this._tabbedPane.changeTabTitle(tabId, title); | 535 this._tabbedPane.changeTabTitle(tabId, title); |
| 536 var icon = null; |
536 if (Persistence.persistence.hasUnsavedCommittedChanges(uiSourceCode)) { | 537 if (Persistence.persistence.hasUnsavedCommittedChanges(uiSourceCode)) { |
537 this._tabbedPane.setTabIcon( | 538 icon = UI.Icon.create('smallicon-warning'); |
538 tabId, 'smallicon-warning', Common.UIString('Changes to this file we
re not saved to file system.')); | 539 icon.title = Common.UIString('Changes to this file were not saved to fil
e system.'); |
539 } else if (Runtime.experiments.isEnabled('persistence2') && Persistence.pe
rsistence.binding(uiSourceCode)) { | 540 } else if (Runtime.experiments.isEnabled('persistence2') && Persistence.pe
rsistence.binding(uiSourceCode)) { |
540 var binding = Persistence.persistence.binding(uiSourceCode); | 541 var binding = Persistence.persistence.binding(uiSourceCode); |
541 this._tabbedPane.setTabIcon( | 542 icon = UI.Icon.create('smallicon-green-checkmark'); |
542 tabId, 'smallicon-green-checkmark', | 543 icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(binding
.fileSystem); |
543 Persistence.PersistenceUtils.tooltipForUISourceCode(binding.fileSyst
em)); | |
544 } else { | |
545 this._tabbedPane.setTabIcon(tabId, ''); | |
546 } | 544 } |
| 545 this._tabbedPane.setTabIcon(tabId, icon); |
547 } | 546 } |
548 } | 547 } |
549 | 548 |
550 /** | 549 /** |
551 * @param {!Common.Event} event | 550 * @param {!Common.Event} event |
552 */ | 551 */ |
553 _uiSourceCodeTitleChanged(event) { | 552 _uiSourceCodeTitleChanged(event) { |
554 var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); | 553 var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); |
555 this._updateFileTitle(uiSourceCode); | 554 this._updateFileTitle(uiSourceCode); |
556 this._updateHistory(); | 555 this._updateHistory(); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 810 |
812 /** | 811 /** |
813 * @override | 812 * @override |
814 * @param {string} tabId | 813 * @param {string} tabId |
815 * @param {!UI.ContextMenu} contextMenu | 814 * @param {!UI.ContextMenu} contextMenu |
816 */ | 815 */ |
817 onContextMenu(tabId, contextMenu) { | 816 onContextMenu(tabId, contextMenu) { |
818 this._editorContainer._onContextMenu(tabId, contextMenu); | 817 this._editorContainer._onContextMenu(tabId, contextMenu); |
819 } | 818 } |
820 }; | 819 }; |
OLD | NEW |