| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 this._updateTabElements(); | 327 this._updateTabElements(); |
| 328 if (focused) | 328 if (focused) |
| 329 this.focus(); | 329 this.focus(); |
| 330 | 330 |
| 331 var eventData = {tabId: id, view: tab.view, isUserGesture: userGesture}; | 331 var eventData = {tabId: id, view: tab.view, isUserGesture: userGesture}; |
| 332 this.dispatchEventToListeners(UI.TabbedPane.Events.TabSelected, eventData); | 332 this.dispatchEventToListeners(UI.TabbedPane.Events.TabSelected, eventData); |
| 333 return true; | 333 return true; |
| 334 } | 334 } |
| 335 | 335 |
| 336 selectNextTab() { |
| 337 var index = this._tabs.indexOf(this._currentTab); |
| 338 var nextIndex = mod(index + 1, this._tabs.length); |
| 339 this.selectTab(this._tabs[nextIndex].id, true); |
| 340 } |
| 341 |
| 342 selectPrevTab() { |
| 343 var index = this._tabs.indexOf(this._currentTab); |
| 344 var nextIndex = mod(index - 1, this._tabs.length); |
| 345 this.selectTab(this._tabs[nextIndex].id, true); |
| 346 } |
| 347 |
| 336 /** | 348 /** |
| 337 * @param {number} tabsCount | 349 * @param {number} tabsCount |
| 338 * @return {!Array.<string>} | 350 * @return {!Array.<string>} |
| 339 */ | 351 */ |
| 340 lastOpenedTabIds(tabsCount) { | 352 lastOpenedTabIds(tabsCount) { |
| 341 function tabToTabId(tab) { | 353 function tabToTabId(tab) { |
| 342 return tab.id; | 354 return tab.id; |
| 343 } | 355 } |
| 344 | 356 |
| 345 return this._tabsHistory.slice(0, tabsCount).map(tabToTabId); | 357 return this._tabsHistory.slice(0, tabsCount).map(tabToTabId); |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 * @param {!Array.<string>} ids | 1215 * @param {!Array.<string>} ids |
| 1204 */ | 1216 */ |
| 1205 closeTabs(tabbedPane, ids) {}, | 1217 closeTabs(tabbedPane, ids) {}, |
| 1206 | 1218 |
| 1207 /** | 1219 /** |
| 1208 * @param {string} tabId | 1220 * @param {string} tabId |
| 1209 * @param {!UI.ContextMenu} contextMenu | 1221 * @param {!UI.ContextMenu} contextMenu |
| 1210 */ | 1222 */ |
| 1211 onContextMenu(tabId, contextMenu) {} | 1223 onContextMenu(tabId, contextMenu) {} |
| 1212 }; | 1224 }; |
| OLD | NEW |