OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 var focused = this.hasFocus(); | 231 var focused = this.hasFocus(); |
232 for (var i = 0; i < ids.length; ++i) | 232 for (var i = 0; i < ids.length; ++i) |
233 this._innerCloseTab(ids[i], userGesture); | 233 this._innerCloseTab(ids[i], userGesture); |
234 this._updateTabElements(); | 234 this._updateTabElements(); |
235 if (this._tabsHistory.length) | 235 if (this._tabsHistory.length) |
236 this.selectTab(this._tabsHistory[0].id, false); | 236 this.selectTab(this._tabsHistory[0].id, false); |
237 if (focused) | 237 if (focused) |
238 this.focus(); | 238 this.focus(); |
239 }, | 239 }, |
240 | 240 |
241 closeAllTabs: function(){ | |
dgozman
2016/06/20 18:32:36
Let's not expose this and revert the change below.
einbinder
2016/06/20 19:28:24
Done.
| |
242 this.closeTabs(this.allTabs()); | |
243 }, | |
244 | |
241 /** | 245 /** |
242 * @param {string} id | 246 * @param {string} id |
243 * @param {boolean=} userGesture | 247 * @param {boolean=} userGesture |
244 */ | 248 */ |
245 _innerCloseTab: function(id, userGesture) | 249 _innerCloseTab: function(id, userGesture) |
246 { | 250 { |
247 if (!this._tabsById[id]) | 251 if (!this._tabsById[id]) |
248 return; | 252 return; |
249 if (userGesture && !this._tabsById[id]._closeable) | 253 if (userGesture && !this._tabsById[id]._closeable) |
250 return; | 254 return; |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1120 function closeOthers() | 1124 function closeOthers() |
1121 { | 1125 { |
1122 this._closeTabs(this._tabbedPane.otherTabs(this.id)); | 1126 this._closeTabs(this._tabbedPane.otherTabs(this.id)); |
1123 } | 1127 } |
1124 | 1128 |
1125 /** | 1129 /** |
1126 * @this {WebInspector.TabbedPaneTab} | 1130 * @this {WebInspector.TabbedPaneTab} |
1127 */ | 1131 */ |
1128 function closeAll() | 1132 function closeAll() |
1129 { | 1133 { |
1130 this._closeTabs(this._tabbedPane.allTabs()); | 1134 this._tabbedPane.closeAllTabs() |
1131 } | 1135 } |
1132 | 1136 |
1133 /** | 1137 /** |
1134 * @this {WebInspector.TabbedPaneTab} | 1138 * @this {WebInspector.TabbedPaneTab} |
1135 */ | 1139 */ |
1136 function closeToTheRight() | 1140 function closeToTheRight() |
1137 { | 1141 { |
1138 this._closeTabs(this._tabbedPane._tabsToTheRight(this.id)); | 1142 this._closeTabs(this._tabbedPane._tabsToTheRight(this.id)); |
1139 } | 1143 } |
1140 | 1144 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 if (this._viewCallback && view) | 1434 if (this._viewCallback && view) |
1431 this._viewCallback(id, view); | 1435 this._viewCallback(id, view); |
1432 var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAnces tor(WebInspector.currentFocusElement()); | 1436 var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAnces tor(WebInspector.currentFocusElement()); |
1433 this._tabbedPane.changeTabView(id, view); | 1437 this._tabbedPane.changeTabView(id, view); |
1434 if (shouldFocus) | 1438 if (shouldFocus) |
1435 view.focus(); | 1439 view.focus(); |
1436 return view; | 1440 return view; |
1437 } | 1441 } |
1438 } | 1442 } |
1439 } | 1443 } |
OLD | NEW |