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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 this._tabbedPane.closeTab(id); | 1191 this._tabbedPane.closeTab(id); |
1192 if (setting.get()) | 1192 if (setting.get()) |
1193 this._tabbedPane.appendTab(id, title, new WebInspector.View()); | 1193 this._tabbedPane.appendTab(id, title, new WebInspector.View()); |
1194 }, | 1194 }, |
1195 | 1195 |
1196 /** | 1196 /** |
1197 * @param {!WebInspector.Event} event | 1197 * @param {!WebInspector.Event} event |
1198 */ | 1198 */ |
1199 _tabSelected: function(event) | 1199 _tabSelected: function(event) |
1200 { | 1200 { |
1201 var tabId = this._tabbedPane.selectedTabId; | 1201 var tabId = /** @type {string} */ (event.data.tabId); |
1202 if (!tabId) | 1202 this.viewForId(tabId).then(viewLoaded.bind(this)).done(); |
1203 return; | 1203 |
1204 this.viewForId(tabId).then(this._tabbedPane.changeTabView.bind(this._tab
bedPane, tabId)).done(); | 1204 /** |
| 1205 * @this {WebInspector.ExtensibleTabbedPaneController} |
| 1206 * @param {!WebInspector.View} view |
| 1207 */ |
| 1208 function viewLoaded(view) |
| 1209 { |
| 1210 var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAnces
tor(WebInspector.currentFocusElement()); |
| 1211 this._tabbedPane.changeTabView(tabId, view); |
| 1212 if (shouldFocus) |
| 1213 view.focus(); |
| 1214 } |
1205 }, | 1215 }, |
1206 | 1216 |
1207 /** | 1217 /** |
1208 * @return {!Array.<string>} | 1218 * @return {!Array.<string>} |
1209 */ | 1219 */ |
1210 viewIds: function() | 1220 viewIds: function() |
1211 { | 1221 { |
1212 return this._extensions.keysArray(); | 1222 return this._extensions.keysArray(); |
1213 }, | 1223 }, |
1214 | 1224 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 /** | 1257 /** |
1248 * @param {string} id1 | 1258 * @param {string} id1 |
1249 * @param {string} id2 | 1259 * @param {string} id2 |
1250 * @return {number} | 1260 * @return {number} |
1251 */ | 1261 */ |
1252 _tabOrderComparator: function(id1, id2) | 1262 _tabOrderComparator: function(id1, id2) |
1253 { | 1263 { |
1254 return this._tabOrders[id2] = this._tabOrders[id1]; | 1264 return this._tabOrders[id2] = this._tabOrders[id1]; |
1255 } | 1265 } |
1256 } | 1266 } |
OLD | NEW |