| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 { |
| 153 return static_cast<Tab*>(tabs_.view_at(index)); | 153 return tabs_.view_at(index); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Returns the index of the specified tab in the model coordinate system, or | 156 // Returns the index of the specified tab in the model coordinate system, or |
| 157 // -1 if tab is closing or not valid. | 157 // -1 if tab is closing or not valid. |
| 158 int GetModelIndexOfTab(const Tab* tab) const; | 158 int GetModelIndexOfTab(const Tab* tab) const; |
| 159 | 159 |
| 160 // Gets the number of Tabs in the tab strip. | 160 // Gets the number of Tabs in the tab strip. |
| 161 int tab_count() const { return tabs_.view_size(); } | 161 int tab_count() const { return tabs_.view_size(); } |
| 162 | 162 |
| 163 // Cover method for TabStripController::GetCount. | 163 // Cover method for TabStripController::GetCount. |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 589 |
| 590 // -- Member Variables ------------------------------------------------------ | 590 // -- Member Variables ------------------------------------------------------ |
| 591 | 591 |
| 592 // There is a one-to-one mapping between each of the tabs in the | 592 // There is a one-to-one mapping between each of the tabs in the |
| 593 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab | 593 // TabStripController (TabStripModel) and |tabs_|. Because we animate tab |
| 594 // removal there exists a period of time where a tab is displayed but not in | 594 // 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 | 595 // 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 | 596 // |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 | 597 // |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. | 598 // painted, and the event handling code ensures only tabs in |tabs_| are used. |
| 599 views::ViewModel tabs_; | 599 views::ViewModel<Tab> tabs_; |
| 600 TabsClosingMap tabs_closing_map_; | 600 TabsClosingMap tabs_closing_map_; |
| 601 | 601 |
| 602 scoped_ptr<TabStripController> controller_; | 602 scoped_ptr<TabStripController> controller_; |
| 603 | 603 |
| 604 // The "New Tab" button. | 604 // The "New Tab" button. |
| 605 NewTabButton* newtab_button_; | 605 NewTabButton* newtab_button_; |
| 606 | 606 |
| 607 // Ideal bounds of the new tab button. | 607 // Ideal bounds of the new tab button. |
| 608 gfx::Rect newtab_button_bounds_; | 608 gfx::Rect newtab_button_bounds_; |
| 609 | 609 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 bool immersive_style_; | 679 bool immersive_style_; |
| 680 | 680 |
| 681 // Our observers. | 681 // Our observers. |
| 682 typedef ObserverList<TabStripObserver> TabStripObservers; | 682 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 683 TabStripObservers observers_; | 683 TabStripObservers observers_; |
| 684 | 684 |
| 685 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 685 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 686 }; | 686 }; |
| 687 | 687 |
| 688 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 688 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |