| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_TABS_TAB_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Invoked when the title of a tab changes and the tab isn't loading. | 143 // Invoked when the title of a tab changes and the tab isn't loading. |
| 144 void TabTitleChangedNotLoading(int model_index); | 144 void TabTitleChangedNotLoading(int model_index); |
| 145 | 145 |
| 146 // Retrieves the ideal bounds for the Tab at the specified index. | 146 // Retrieves the ideal bounds for the Tab at the specified index. |
| 147 const gfx::Rect& ideal_bounds(int tab_data_index) { | 147 const gfx::Rect& ideal_bounds(int tab_data_index) { |
| 148 return tabs_.ideal_bounds(tab_data_index); | 148 return tabs_.ideal_bounds(tab_data_index); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Returns the Tab at |index|. | 151 // Returns the Tab at |index|. |
| 152 Tab* tab_at(int index) const { | 152 Tab* tab_at(int index) const { return tabs_.view_at(index); } |
| 153 return static_cast<Tab*>(tabs_.view_at(index)); | |
| 154 } | |
| 155 | 153 |
| 156 // Returns the index of the specified tab in the model coordinate system, or | 154 // Returns the index of the specified tab in the model coordinate system, or |
| 157 // -1 if tab is closing or not valid. | 155 // -1 if tab is closing or not valid. |
| 158 int GetModelIndexOfTab(const Tab* tab) const; | 156 int GetModelIndexOfTab(const Tab* tab) const; |
| 159 | 157 |
| 160 // Gets the number of Tabs in the tab strip. | 158 // Gets the number of Tabs in the tab strip. |
| 161 int tab_count() const { return tabs_.view_size(); } | 159 int tab_count() const { return tabs_.view_size(); } |
| 162 | 160 |
| 163 // Cover method for TabStripController::GetCount. | 161 // Cover method for TabStripController::GetCount. |
| 164 int GetModelCount() const; | 162 int GetModelCount() const; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 587 |
| 590 // -- Member Variables ------------------------------------------------------ | 588 // -- Member Variables ------------------------------------------------------ |
| 591 | 589 |
| 592 // There is a one-to-one mapping between each of the tabs in the | 590 // There is a one-to-one mapping between each of the tabs in the |
| 593 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab | 591 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab |
| 594 // removal there exists a period of time where a tab is displayed but not in | 592 // removal there exists a period of time where a tab is displayed but not in |
| 595 // the model. When this occurs the tab is removed from |tabs_| and placed in | 593 // the model. When this occurs the tab is removed from |tabs_| and placed in |
| 596 // |tabs_closing_map_|. When the animation completes the tab is removed from | 594 // |tabs_closing_map_|. When the animation completes the tab is removed from |
| 597 // |tabs_closing_map_|. The painting code ensures both sets of tabs are | 595 // |tabs_closing_map_|. The painting code ensures both sets of tabs are |
| 598 // painted, and the event handling code ensures only tabs in |tabs_| are used. | 596 // painted, and the event handling code ensures only tabs in |tabs_| are used. |
| 599 views::ViewModel tabs_; | 597 views::ViewModelT<Tab> tabs_; |
| 600 TabsClosingMap tabs_closing_map_; | 598 TabsClosingMap tabs_closing_map_; |
| 601 | 599 |
| 602 scoped_ptr<TabStripController> controller_; | 600 scoped_ptr<TabStripController> controller_; |
| 603 | 601 |
| 604 // The "New Tab" button. | 602 // The "New Tab" button. |
| 605 NewTabButton* newtab_button_; | 603 NewTabButton* newtab_button_; |
| 606 | 604 |
| 607 // Ideal bounds of the new tab button. | 605 // Ideal bounds of the new tab button. |
| 608 gfx::Rect newtab_button_bounds_; | 606 gfx::Rect newtab_button_bounds_; |
| 609 | 607 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 bool immersive_style_; | 677 bool immersive_style_; |
| 680 | 678 |
| 681 // Our observers. | 679 // Our observers. |
| 682 typedef ObserverList<TabStripObserver> TabStripObservers; | 680 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 683 TabStripObservers observers_; | 681 TabStripObservers observers_; |
| 684 | 682 |
| 685 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 683 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 686 }; | 684 }; |
| 687 | 685 |
| 688 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 686 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |