OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_TABS_TAB_STRIP_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
6 #define CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
7 | 7 |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
10 #include "chrome/browser/views/tabs/base_tab_strip.h" | 10 #include "chrome/browser/views/tabs/base_tab_strip.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Returns the currently selected tab. | 67 // Returns the currently selected tab. |
68 Tab* GetSelectedTab() const; | 68 Tab* GetSelectedTab() const; |
69 | 69 |
70 // Create the new tab button. | 70 // Create the new tab button. |
71 void InitTabStripButtons(); | 71 void InitTabStripButtons(); |
72 | 72 |
73 // Return true if this tab strip is compatible with the provided tab strip. | 73 // Return true if this tab strip is compatible with the provided tab strip. |
74 // Compatible tab strips can transfer tabs during drag and drop. | 74 // Compatible tab strips can transfer tabs during drag and drop. |
75 bool IsCompatibleWith(TabStrip* other) const; | 75 bool IsCompatibleWith(TabStrip* other) const; |
76 | 76 |
| 77 // Populates the BaseTabStrip implementation from its model. This is primarily |
| 78 // useful when switching between display types and there are existing tabs. |
| 79 // Upon initial creation the TabStrip is empty. |
| 80 void InitFromModel(); |
| 81 |
77 // BaseTabStrip implementation: | 82 // BaseTabStrip implementation: |
78 virtual int GetPreferredHeight(); | 83 virtual int GetPreferredHeight(); |
79 virtual void SetBackgroundOffset(const gfx::Point& offset); | 84 virtual void SetBackgroundOffset(const gfx::Point& offset); |
80 virtual bool IsPositionInWindowCaption(const gfx::Point& point); | 85 virtual bool IsPositionInWindowCaption(const gfx::Point& point); |
81 virtual void SetDraggedTabBounds(int tab_index, | 86 virtual void SetDraggedTabBounds(int tab_index, |
82 const gfx::Rect& tab_bounds); | 87 const gfx::Rect& tab_bounds); |
83 virtual bool IsDragSessionActive() const; | 88 virtual bool IsDragSessionActive() const; |
84 virtual void UpdateLoadingAnimations(); | 89 virtual void UpdateLoadingAnimations(); |
85 virtual bool IsAnimating() const; | 90 virtual bool IsAnimating() const; |
86 virtual TabStrip* AsTabStrip(); | 91 virtual TabStrip* AsTabStrip(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 virtual void TabMiniStateChanged(TabContents* contents, int index); | 134 virtual void TabMiniStateChanged(TabContents* contents, int index); |
130 virtual void TabBlockedStateChanged(TabContents* contents, int index); | 135 virtual void TabBlockedStateChanged(TabContents* contents, int index); |
131 | 136 |
132 // Tab::Delegate implementation: | 137 // Tab::Delegate implementation: |
133 virtual bool IsTabSelected(const Tab* tab) const; | 138 virtual bool IsTabSelected(const Tab* tab) const; |
134 virtual bool IsTabPinned(const Tab* tab) const; | 139 virtual bool IsTabPinned(const Tab* tab) const; |
135 virtual void SelectTab(Tab* tab); | 140 virtual void SelectTab(Tab* tab); |
136 virtual void CloseTab(Tab* tab); | 141 virtual void CloseTab(Tab* tab); |
137 virtual bool IsCommandEnabledForTab( | 142 virtual bool IsCommandEnabledForTab( |
138 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; | 143 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; |
| 144 virtual bool IsCommandCheckedForTab( |
| 145 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; |
139 virtual void ExecuteCommandForTab( | 146 virtual void ExecuteCommandForTab( |
140 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 147 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
141 virtual void StartHighlightTabsForCommand( | 148 virtual void StartHighlightTabsForCommand( |
142 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 149 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
143 virtual void StopHighlightTabsForCommand( | 150 virtual void StopHighlightTabsForCommand( |
144 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 151 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
145 virtual void StopAllHighlighting(); | 152 virtual void StopAllHighlighting(); |
146 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); | 153 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); |
147 virtual void ContinueDrag(const views::MouseEvent& event); | 154 virtual void ContinueDrag(const views::MouseEvent& event); |
148 virtual bool EndDrag(bool canceled); | 155 virtual bool EndDrag(bool canceled); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 }; | 410 }; |
404 std::vector<TabData> tab_data_; | 411 std::vector<TabData> tab_data_; |
405 | 412 |
406 // The currently running animation. | 413 // The currently running animation. |
407 scoped_ptr<TabAnimation> active_animation_; | 414 scoped_ptr<TabAnimation> active_animation_; |
408 | 415 |
409 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 416 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
410 }; | 417 }; |
411 | 418 |
412 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ | 419 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |