| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 // | 508 // |
| 509 // The boolean parameter create_historical_tab controls whether to | 509 // The boolean parameter create_historical_tab controls whether to |
| 510 // record these tabs and their history for reopening recently closed | 510 // record these tabs and their history for reopening recently closed |
| 511 // tabs. | 511 // tabs. |
| 512 void InternalCloseTab(TabContentsWrapper* contents, | 512 void InternalCloseTab(TabContentsWrapper* contents, |
| 513 int index, | 513 int index, |
| 514 bool create_historical_tabs); | 514 bool create_historical_tabs); |
| 515 | 515 |
| 516 TabContentsWrapper* GetContentsAt(int index) const; | 516 TabContentsWrapper* GetContentsAt(int index) const; |
| 517 | 517 |
| 518 // If the TabContentsWrapper at |to_index| differs from |old_contents| | 518 // Notifies the observers if the active tab or the tab selection has changed. |
| 519 // notifies observers. | 519 // If |old_contents| is non-null a TabDeactivated notification is sent right |
| 520 void NotifyTabSelectedIfChanged(TabContentsWrapper* old_contents, | 520 // before sending ActiveTabChanged notification. |old_model| is a snapshot of |
| 521 int to_index, | 521 // |selection_model_| before the change. |
| 522 bool user_gesture); | 522 // Note: This function might end up sending 0 to 3 notifications in the |
| 523 | 523 // following order: TabDeactivated, ActiveTabChanged, TabSelectionChanged. |
| 524 // Notifies the observers the active tab changed. |old_active_index| gives | 524 void NotifyIfActiveOrSelectionChanged( |
| 525 // the old active index. | 525 TabContentsWrapper* old_contents, |
| 526 void NotifyActiveTabChanged(int old_active_index); | 526 bool user_gesture, |
| 527 const TabStripSelectionModel& old_model); |
| 527 | 528 |
| 528 // Returns the number of New Tab tabs in the TabStripModel. | 529 // Returns the number of New Tab tabs in the TabStripModel. |
| 529 int GetNewTabCount() const; | 530 int GetNewTabCount() const; |
| 530 | 531 |
| 531 // Selects either the next tab (|foward| is true), or the previous tab | 532 // Selects either the next tab (|foward| is true), or the previous tab |
| 532 // (|forward| is false). | 533 // (|forward| is false). |
| 533 void SelectRelativeTab(bool forward); | 534 void SelectRelativeTab(bool forward); |
| 534 | 535 |
| 535 // Does the work of MoveTabContentsAt. This has no checks to make sure the | 536 // Does the work of MoveTabContentsAt. This has no checks to make sure the |
| 536 // position is valid, those are done in MoveTabContentsAt. | 537 // position is valid, those are done in MoveTabContentsAt. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 635 |
| 635 // A scoped container for notification registries. | 636 // A scoped container for notification registries. |
| 636 NotificationRegistrar registrar_; | 637 NotificationRegistrar registrar_; |
| 637 | 638 |
| 638 TabStripSelectionModel selection_model_; | 639 TabStripSelectionModel selection_model_; |
| 639 | 640 |
| 640 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); | 641 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); |
| 641 }; | 642 }; |
| 642 | 643 |
| 643 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 644 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| OLD | NEW |