OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // in response to dragged tabs. | 35 // in response to dragged tabs. |
36 // | 36 // |
37 /////////////////////////////////////////////////////////////////////////////// | 37 /////////////////////////////////////////////////////////////////////////////// |
38 class TabStrip : public BaseTabStrip, | 38 class TabStrip : public BaseTabStrip, |
39 public views::ButtonListener, | 39 public views::ButtonListener, |
40 public views::MouseWatcherListener { | 40 public views::MouseWatcherListener { |
41 public: | 41 public: |
42 explicit TabStrip(TabStripController* controller); | 42 explicit TabStrip(TabStripController* controller); |
43 virtual ~TabStrip(); | 43 virtual ~TabStrip(); |
44 | 44 |
45 // Creates the new tab button. | |
46 void InitTabStripButtons(); | |
47 | |
48 // Returns the bounds of the new tab button. | 45 // Returns the bounds of the new tab button. |
49 gfx::Rect GetNewTabButtonBounds(); | 46 gfx::Rect GetNewTabButtonBounds(); |
50 | 47 |
| 48 // Does he new tab button need to be sized to the top of the tab strip? |
| 49 bool SizeTabButtonToTopOfTabStrip(); |
| 50 |
51 // MouseWatcherListener overrides: | 51 // MouseWatcherListener overrides: |
52 virtual void MouseMovedOutOfView() OVERRIDE; | 52 virtual void MouseMovedOutOfView() OVERRIDE; |
53 | 53 |
54 // AbstractTabStripView implementation: | 54 // AbstractTabStripView implementation: |
55 virtual bool IsPositionInWindowCaption(const gfx::Point& point) OVERRIDE; | 55 virtual bool IsPositionInWindowCaption(const gfx::Point& point) OVERRIDE; |
56 virtual void SetBackgroundOffset(const gfx::Point& offset) OVERRIDE; | 56 virtual void SetBackgroundOffset(const gfx::Point& offset) OVERRIDE; |
57 | 57 |
58 // BaseTabStrip implementation: | 58 // BaseTabStrip implementation: |
59 virtual void PrepareForCloseAt(int model_index) OVERRIDE; | 59 virtual void PrepareForCloseAt(int model_index) OVERRIDE; |
60 virtual void RemoveTabAt(int model_index) OVERRIDE; | 60 virtual void RemoveTabAt(int model_index) OVERRIDE; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Renders the drop indicator. | 132 // Renders the drop indicator. |
133 views::Widget* arrow_window; | 133 views::Widget* arrow_window; |
134 views::ImageView* arrow_view; | 134 views::ImageView* arrow_view; |
135 | 135 |
136 private: | 136 private: |
137 DISALLOW_COPY_AND_ASSIGN(DropInfo); | 137 DISALLOW_COPY_AND_ASSIGN(DropInfo); |
138 }; | 138 }; |
139 | 139 |
140 void Init(); | 140 void Init(); |
141 | 141 |
| 142 // Creates the new tab button. |
| 143 void InitTabStripButtons(); |
| 144 |
142 // Set the images for the new tab button. | 145 // Set the images for the new tab button. |
143 void LoadNewTabButtonImage(); | 146 void LoadNewTabButtonImage(); |
144 | 147 |
145 // Retrieves the Tab at the specified index. Remember, the specified index | 148 // Retrieves the Tab at the specified index. Remember, the specified index |
146 // is in terms of tab_data, *not* the model. | 149 // is in terms of tab_data, *not* the model. |
147 Tab* GetTabAtTabDataIndex(int tab_data_index) const; | 150 Tab* GetTabAtTabDataIndex(int tab_data_index) const; |
148 | 151 |
149 // Returns the tab at the specified index. If a remove animation is on going | 152 // Returns the tab at the specified index. If a remove animation is on going |
150 // and the index is >= the index of the tab being removed, the index is | 153 // and the index is >= the index of the tab being removed, the index is |
151 // incremented. While a remove operation is on going the indices of the model | 154 // incremented. While a remove operation is on going the indices of the model |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 268 |
266 // Used for stage 1 of new tab animation. | 269 // Used for stage 1 of new tab animation. |
267 base::OneShotTimer<TabStrip> new_tab_timer_; | 270 base::OneShotTimer<TabStrip> new_tab_timer_; |
268 | 271 |
269 scoped_ptr<views::MouseWatcher> mouse_watcher_; | 272 scoped_ptr<views::MouseWatcher> mouse_watcher_; |
270 | 273 |
271 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 274 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
272 }; | 275 }; |
273 | 276 |
274 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 277 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |