OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SIDE_TAB_STRIP_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ |
6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ |
7 | 7 |
8 #include "chrome/browser/views/tabs/base_tab_strip.h" | 8 #include "chrome/browser/views/tabs/base_tab_strip.h" |
9 | 9 |
10 struct TabRendererData; | 10 struct TabRendererData; |
11 | 11 |
12 class SideTabStrip : public BaseTabStrip { | 12 class SideTabStrip : public BaseTabStrip { |
13 public: | 13 public: |
14 explicit SideTabStrip(TabStripController* controller); | 14 explicit SideTabStrip(TabStripController* controller); |
15 virtual ~SideTabStrip(); | 15 virtual ~SideTabStrip(); |
16 | 16 |
17 // BaseTabStrip implementation: | 17 // BaseTabStrip implementation: |
18 virtual int GetPreferredHeight(); | 18 virtual int GetPreferredHeight(); |
19 virtual void SetBackgroundOffset(const gfx::Point& offset); | 19 virtual void SetBackgroundOffset(const gfx::Point& offset); |
20 virtual bool IsPositionInWindowCaption(const gfx::Point& point); | 20 virtual bool IsPositionInWindowCaption(const gfx::Point& point); |
21 virtual void SetDraggedTabBounds(int tab_index, | 21 virtual void SetDraggedTabBounds(int tab_index, |
22 const gfx::Rect& tab_bounds); | 22 const gfx::Rect& tab_bounds); |
23 virtual bool IsDragSessionActive() const; | |
24 virtual bool IsAnimating() const; | 23 virtual bool IsAnimating() const; |
25 virtual TabStrip* AsTabStrip(); | 24 virtual TabStrip* AsTabStrip(); |
26 | 25 |
27 virtual void StartHighlight(int model_index); | 26 virtual void StartHighlight(int model_index); |
28 virtual void StopAllHighlighting(); | 27 virtual void StopAllHighlighting(); |
29 virtual BaseTabRenderer* GetBaseTabAtModelIndex(int model_index) const; | 28 virtual BaseTabRenderer* GetBaseTabAtModelIndex(int model_index) const; |
30 virtual BaseTabRenderer* GetBaseTabAtTabIndex(int tab_index) const; | |
31 virtual int GetModelIndexOfBaseTab(const BaseTabRenderer* tab) const; | |
32 virtual int GetTabCount() const; | |
33 virtual BaseTabRenderer* CreateTabForDragging(); | 29 virtual BaseTabRenderer* CreateTabForDragging(); |
34 virtual void AddTabAt(int model_index, | |
35 bool foreground, | |
36 const TabRendererData& data); | |
37 virtual void RemoveTabAt(int model_index, bool initiated_close); | 30 virtual void RemoveTabAt(int model_index, bool initiated_close); |
38 virtual void SelectTabAt(int old_model_index, int new_model_index); | 31 virtual void SelectTabAt(int old_model_index, int new_model_index); |
39 virtual void MoveTab(int from_model_index, int to_model_index); | |
40 virtual void TabTitleChangedNotLoading(int model_index); | 32 virtual void TabTitleChangedNotLoading(int model_index); |
41 virtual void SetTabData(int model_index, const TabRendererData& data); | 33 virtual void SetTabData(int model_index, const TabRendererData& data); |
42 virtual void MaybeStartDrag(BaseTabRenderer* tab, | |
43 const views::MouseEvent& event); | |
44 virtual void ContinueDrag(const views::MouseEvent& event); | |
45 virtual bool EndDrag(bool canceled); | |
46 | 34 |
47 // views::View overrides: | 35 // views::View overrides: |
48 virtual void Layout(); | |
49 virtual gfx::Size GetPreferredSize(); | 36 virtual gfx::Size GetPreferredSize(); |
50 | 37 |
| 38 protected: |
| 39 // BaseTabStrip overrides: |
| 40 virtual BaseTabRenderer* CreateTab(); |
| 41 virtual void GenerateIdealBounds(); |
| 42 virtual void StartInsertTabAnimation(int model_index, bool foreground); |
| 43 virtual void StartMoveTabAnimation(); |
| 44 virtual void StopAnimating(bool layout); |
| 45 virtual void StartedDraggingTab(BaseTabRenderer* tab) {} |
| 46 virtual void StoppedDraggingTab(BaseTabRenderer* tab) {} |
| 47 |
51 private: | 48 private: |
52 DISALLOW_COPY_AND_ASSIGN(SideTabStrip); | 49 DISALLOW_COPY_AND_ASSIGN(SideTabStrip); |
53 }; | 50 }; |
54 | 51 |
55 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ | 52 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ |
OLD | NEW |