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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 hasTab: function(tabId) | 271 hasTab: function(tabId) |
272 { | 272 { |
273 return !!this._tabsById[tabId]; | 273 return !!this._tabsById[tabId]; |
274 }, | 274 }, |
275 | 275 |
276 /** | 276 /** |
277 * @return {!Array.<string>} | 277 * @return {!Array.<string>} |
278 */ | 278 */ |
279 allTabs: function() | 279 allTabs: function() |
280 { | 280 { |
281 return this._tabs.map(function (tab) { return tab.id; }); | 281 return this._tabs.map(function(tab) { return tab.id; }); |
282 }, | 282 }, |
283 | 283 |
284 /** | 284 /** |
285 * @param {string} id | 285 * @param {string} id |
286 * @return {!Array.<string>} | 286 * @return {!Array.<string>} |
287 */ | 287 */ |
288 otherTabs: function(id) | 288 otherTabs: function(id) |
289 { | 289 { |
290 var result = []; | 290 var result = []; |
291 for (var i = 0; i < this._tabs.length; ++i) { | 291 for (var i = 0; i < this._tabs.length; ++i) { |
(...skipping 11 matching lines...) Expand all Loading... |
303 { | 303 { |
304 var index = -1; | 304 var index = -1; |
305 for (var i = 0; i < this._tabs.length; ++i) { | 305 for (var i = 0; i < this._tabs.length; ++i) { |
306 if (this._tabs[i].id === id) { | 306 if (this._tabs[i].id === id) { |
307 index = i; | 307 index = i; |
308 break; | 308 break; |
309 } | 309 } |
310 } | 310 } |
311 if (index === -1) | 311 if (index === -1) |
312 return []; | 312 return []; |
313 return this._tabs.slice(index + 1).map(function (tab) { return tab.id; }
); | 313 return this._tabs.slice(index + 1).map(function(tab) { return tab.id; })
; |
314 }, | 314 }, |
315 | 315 |
316 /** | 316 /** |
317 * @param {string} id | 317 * @param {string} id |
318 * @param {boolean=} userGesture | 318 * @param {boolean=} userGesture |
319 * @return {boolean} | 319 * @return {boolean} |
320 */ | 320 */ |
321 selectTab: function(id, userGesture) | 321 selectTab: function(id, userGesture) |
322 { | 322 { |
323 if (this._currentTabLocked) | 323 if (this._currentTabLocked) |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 if (this._viewCallback && view) | 1430 if (this._viewCallback && view) |
1431 this._viewCallback(id, view); | 1431 this._viewCallback(id, view); |
1432 var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAnces
tor(WebInspector.currentFocusElement()); | 1432 var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAnces
tor(WebInspector.currentFocusElement()); |
1433 this._tabbedPane.changeTabView(id, view); | 1433 this._tabbedPane.changeTabView(id, view); |
1434 if (shouldFocus) | 1434 if (shouldFocus) |
1435 view.focus(); | 1435 view.focus(); |
1436 return view; | 1436 return view; |
1437 } | 1437 } |
1438 } | 1438 } |
1439 } | 1439 } |
OLD | NEW |