| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 * @param {string} id | 291 * @param {string} id |
| 292 * @param {string} nextTabId | 292 * @param {string} nextTabId |
| 293 */ | 293 */ |
| 294 _maybeCloseTab(id, nextTabId) { | 294 _maybeCloseTab(id, nextTabId) { |
| 295 var uiSourceCode = this._files[id]; | 295 var uiSourceCode = this._files[id]; |
| 296 var shouldPrompt = uiSourceCode.isDirty() && uiSourceCode.project().canSetFi
leContent(); | 296 var shouldPrompt = uiSourceCode.isDirty() && uiSourceCode.project().canSetFi
leContent(); |
| 297 // FIXME: this should be replaced with common Save/Discard/Cancel dialog. | 297 // FIXME: this should be replaced with common Save/Discard/Cancel dialog. |
| 298 if (!shouldPrompt || | 298 if (!shouldPrompt || |
| 299 confirm(Common.UIString('Are you sure you want to close unsaved file: %s
?', uiSourceCode.name()))) { | 299 confirm(Common.UIString('Are you sure you want to close unsaved file: %s
?', uiSourceCode.name()))) { |
| 300 uiSourceCode.resetWorkingCopy(); | 300 uiSourceCode.resetWorkingCopy(); |
| 301 var previousView = this._currentView; | |
| 302 if (nextTabId) | 301 if (nextTabId) |
| 303 this._tabbedPane.selectTab(nextTabId, true); | 302 this._tabbedPane.selectTab(nextTabId, true); |
| 304 this._tabbedPane.closeTab(id, true); | 303 this._tabbedPane.closeTab(id, true); |
| 305 return true; | 304 return true; |
| 306 } | 305 } |
| 307 return false; | 306 return false; |
| 308 } | 307 } |
| 309 | 308 |
| 310 /** | 309 /** |
| 311 * @param {!Array.<string>} ids | 310 * @param {!Array.<string>} ids |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 | 811 |
| 813 /** | 812 /** |
| 814 * @override | 813 * @override |
| 815 * @param {string} tabId | 814 * @param {string} tabId |
| 816 * @param {!UI.ContextMenu} contextMenu | 815 * @param {!UI.ContextMenu} contextMenu |
| 817 */ | 816 */ |
| 818 onContextMenu(tabId, contextMenu) { | 817 onContextMenu(tabId, contextMenu) { |
| 819 this._editorContainer._onContextMenu(tabId, contextMenu); | 818 this._editorContainer._onContextMenu(tabId, contextMenu); |
| 820 } | 819 } |
| 821 }; | 820 }; |
| OLD | NEW |