| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 { | 76 { |
| 77 this._shrinkableTabs = shrinkableTabs; | 77 this._shrinkableTabs = shrinkableTabs; |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 /** | 80 /** |
| 81 * @type {boolean} verticalTabLayout | 81 * @type {boolean} verticalTabLayout |
| 82 */ | 82 */ |
| 83 set verticalTabLayout(verticalTabLayout) | 83 set verticalTabLayout(verticalTabLayout) |
| 84 { | 84 { |
| 85 this._verticalTabLayout = verticalTabLayout; | 85 this._verticalTabLayout = verticalTabLayout; |
| 86 this.invalidateMinimumSize(); |
| 86 }, | 87 }, |
| 87 | 88 |
| 88 /** | 89 /** |
| 89 * @type {boolean} closeableTabs | 90 * @type {boolean} closeableTabs |
| 90 */ | 91 */ |
| 91 set closeableTabs(closeableTabs) | 92 set closeableTabs(closeableTabs) |
| 92 { | 93 { |
| 93 this._closeableTabs = closeableTabs; | 94 this._closeableTabs = closeableTabs; |
| 94 }, | 95 }, |
| 95 | 96 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 { | 280 { |
| 280 var tab = this._tabsById[id]; | 281 var tab = this._tabsById[id]; |
| 281 if (!tab) | 282 if (!tab) |
| 282 return; | 283 return; |
| 283 if (this._currentTab && this._currentTab.id === id) | 284 if (this._currentTab && this._currentTab.id === id) |
| 284 return; | 285 return; |
| 285 | 286 |
| 286 this._hideCurrentTab(); | 287 this._hideCurrentTab(); |
| 287 this._showTab(tab); | 288 this._showTab(tab); |
| 288 this._currentTab = tab; | 289 this._currentTab = tab; |
| 289 | 290 |
| 290 this._tabsHistory.splice(this._tabsHistory.indexOf(tab), 1); | 291 this._tabsHistory.splice(this._tabsHistory.indexOf(tab), 1); |
| 291 this._tabsHistory.splice(0, 0, tab); | 292 this._tabsHistory.splice(0, 0, tab); |
| 292 | 293 |
| 293 this._updateTabElements(); | 294 this._updateTabElements(); |
| 294 | 295 |
| 295 var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture
}; | 296 var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture
}; |
| 296 this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSele
cted, eventData); | 297 this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSele
cted, eventData); |
| 297 }, | 298 }, |
| 298 | 299 |
| 299 /** | 300 /** |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 headerResized: function() | 369 headerResized: function() |
| 369 { | 370 { |
| 370 this._updateTabElements(); | 371 this._updateTabElements(); |
| 371 }, | 372 }, |
| 372 | 373 |
| 373 wasShown: function() | 374 wasShown: function() |
| 374 { | 375 { |
| 375 var effectiveTab = this._currentTab || this._tabsHistory[0]; | 376 var effectiveTab = this._currentTab || this._tabsHistory[0]; |
| 376 if (effectiveTab) | 377 if (effectiveTab) |
| 377 this.selectTab(effectiveTab.id); | 378 this.selectTab(effectiveTab.id); |
| 379 this.invalidateMinimumSize(); |
| 380 }, |
| 381 |
| 382 /** |
| 383 * @return {!Size} |
| 384 */ |
| 385 calculateMinimumSize: function() |
| 386 { |
| 387 var size = WebInspector.VBox.prototype.calculateMinimumSize.call(this); |
| 388 if (this._verticalTabLayout) |
| 389 size.width += this._headerElement.offsetWidth; |
| 390 else |
| 391 size.height += this._headerElement.offsetHeight; |
| 392 return size; |
| 378 }, | 393 }, |
| 379 | 394 |
| 380 _updateTabElements: function() | 395 _updateTabElements: function() |
| 381 { | 396 { |
| 382 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen
ts); | 397 WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElemen
ts); |
| 383 }, | 398 }, |
| 384 | 399 |
| 385 /** | 400 /** |
| 386 * @param {string} text | 401 * @param {string} text |
| 387 */ | 402 */ |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 { | 1128 { |
| 1114 if (this._views.contains(id)) | 1129 if (this._views.contains(id)) |
| 1115 return /** @type {!WebInspector.View} */ (this._views.get(id)); | 1130 return /** @type {!WebInspector.View} */ (this._views.get(id)); |
| 1116 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; | 1131 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; |
| 1117 this._views.put(id, view); | 1132 this._views.put(id, view); |
| 1118 if (this._viewCallback && view) | 1133 if (this._viewCallback && view) |
| 1119 this._viewCallback(id, view); | 1134 this._viewCallback(id, view); |
| 1120 return view; | 1135 return view; |
| 1121 } | 1136 } |
| 1122 } | 1137 } |
| OLD | NEW |