| 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 | |
| 82 // BaseTabStrip implementation: | 77 // BaseTabStrip implementation: |
| 83 virtual int GetPreferredHeight(); | 78 virtual int GetPreferredHeight(); |
| 84 virtual void SetBackgroundOffset(const gfx::Point& offset); | 79 virtual void SetBackgroundOffset(const gfx::Point& offset); |
| 85 virtual bool IsPositionInWindowCaption(const gfx::Point& point); | 80 virtual bool IsPositionInWindowCaption(const gfx::Point& point); |
| 86 virtual void SetDraggedTabBounds(int tab_index, | 81 virtual void SetDraggedTabBounds(int tab_index, |
| 87 const gfx::Rect& tab_bounds); | 82 const gfx::Rect& tab_bounds); |
| 88 virtual bool IsDragSessionActive() const; | 83 virtual bool IsDragSessionActive() const; |
| 89 virtual void UpdateLoadingAnimations(); | 84 virtual void UpdateLoadingAnimations(); |
| 90 virtual bool IsAnimating() const; | 85 virtual bool IsAnimating() const; |
| 91 virtual TabStrip* AsTabStrip(); | 86 virtual TabStrip* AsTabStrip(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 virtual void TabMiniStateChanged(TabContents* contents, int index); | 129 virtual void TabMiniStateChanged(TabContents* contents, int index); |
| 135 virtual void TabBlockedStateChanged(TabContents* contents, int index); | 130 virtual void TabBlockedStateChanged(TabContents* contents, int index); |
| 136 | 131 |
| 137 // Tab::Delegate implementation: | 132 // Tab::Delegate implementation: |
| 138 virtual bool IsTabSelected(const Tab* tab) const; | 133 virtual bool IsTabSelected(const Tab* tab) const; |
| 139 virtual bool IsTabPinned(const Tab* tab) const; | 134 virtual bool IsTabPinned(const Tab* tab) const; |
| 140 virtual void SelectTab(Tab* tab); | 135 virtual void SelectTab(Tab* tab); |
| 141 virtual void CloseTab(Tab* tab); | 136 virtual void CloseTab(Tab* tab); |
| 142 virtual bool IsCommandEnabledForTab( | 137 virtual bool IsCommandEnabledForTab( |
| 143 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; | 138 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; |
| 144 virtual bool IsCommandCheckedForTab( | |
| 145 TabStripModel::ContextMenuCommand command_id, const Tab* tab) const; | |
| 146 virtual void ExecuteCommandForTab( | 139 virtual void ExecuteCommandForTab( |
| 147 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 140 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
| 148 virtual void StartHighlightTabsForCommand( | 141 virtual void StartHighlightTabsForCommand( |
| 149 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 142 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
| 150 virtual void StopHighlightTabsForCommand( | 143 virtual void StopHighlightTabsForCommand( |
| 151 TabStripModel::ContextMenuCommand command_id, Tab* tab); | 144 TabStripModel::ContextMenuCommand command_id, Tab* tab); |
| 152 virtual void StopAllHighlighting(); | 145 virtual void StopAllHighlighting(); |
| 153 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); | 146 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); |
| 154 virtual void ContinueDrag(const views::MouseEvent& event); | 147 virtual void ContinueDrag(const views::MouseEvent& event); |
| 155 virtual bool EndDrag(bool canceled); | 148 virtual bool EndDrag(bool canceled); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 }; | 403 }; |
| 411 std::vector<TabData> tab_data_; | 404 std::vector<TabData> tab_data_; |
| 412 | 405 |
| 413 // The currently running animation. | 406 // The currently running animation. |
| 414 scoped_ptr<TabAnimation> active_animation_; | 407 scoped_ptr<TabAnimation> active_animation_; |
| 415 | 408 |
| 416 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 409 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 417 }; | 410 }; |
| 418 | 411 |
| 419 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ | 412 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |