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_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 "app/animation_container.h" | 8 #include "app/animation_container.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 virtual void WillProcessMessage(const MSG& msg); | 115 virtual void WillProcessMessage(const MSG& msg); |
116 virtual void DidProcessMessage(const MSG& msg); | 116 virtual void DidProcessMessage(const MSG& msg); |
117 #else | 117 #else |
118 virtual void WillProcessEvent(GdkEvent* event); | 118 virtual void WillProcessEvent(GdkEvent* event); |
119 virtual void DidProcessEvent(GdkEvent* event); | 119 virtual void DidProcessEvent(GdkEvent* event); |
120 #endif | 120 #endif |
121 | 121 |
122 // Horizontal gap between mini and non-mini-tabs. | 122 // Horizontal gap between mini and non-mini-tabs. |
123 static const int mini_to_non_mini_gap_; | 123 static const int mini_to_non_mini_gap_; |
124 | 124 |
125 // Extra horizontal gap (on top of mini_to_non_mini_gap_) when one of the | |
126 // mini tabs is a nano tab. | |
127 static const int extra_gap_for_nano_; | |
128 | |
129 private: | 125 private: |
130 friend class DraggedTabController; | 126 friend class DraggedTabController; |
131 | 127 |
132 // Used during a drop session of a url. Tracks the position of the drop as | 128 // Used during a drop session of a url. Tracks the position of the drop as |
133 // well as a window used to highlight where the drop occurs. | 129 // well as a window used to highlight where the drop occurs. |
134 struct DropInfo { | 130 struct DropInfo { |
135 DropInfo(int index, bool drop_before, bool paint_down); | 131 DropInfo(int index, bool drop_before, bool paint_down); |
136 ~DropInfo(); | 132 ~DropInfo(); |
137 | 133 |
138 // Index of the tab to drop on. If drop_before is true, the drop should | 134 // Index of the tab to drop on. If drop_before is true, the drop should |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // incremented. While a remove operation is on going the indices of the model | 170 // incremented. While a remove operation is on going the indices of the model |
175 // do not line up with the indices of the view. This method adjusts the index | 171 // do not line up with the indices of the view. This method adjusts the index |
176 // accordingly. | 172 // accordingly. |
177 // | 173 // |
178 // Use this instead of GetTabAtTabDataIndex if the index comes from the model. | 174 // Use this instead of GetTabAtTabDataIndex if the index comes from the model. |
179 Tab* GetTabAtModelIndex(int model_index) const; | 175 Tab* GetTabAtModelIndex(int model_index) const; |
180 | 176 |
181 // Returns the number of mini-tabs. | 177 // Returns the number of mini-tabs. |
182 int GetMiniTabCount() const; | 178 int GetMiniTabCount() const; |
183 | 179 |
184 // Returns the number of nano-tabs. | |
185 int GetNanoTabCount() const; | |
186 | |
187 // -- Tab Resize Layout ----------------------------------------------------- | 180 // -- Tab Resize Layout ----------------------------------------------------- |
188 | 181 |
189 // Returns the exact (unrounded) current width of each tab. | 182 // Returns the exact (unrounded) current width of each tab. |
190 void GetCurrentTabWidths(double* unselected_width, | 183 void GetCurrentTabWidths(double* unselected_width, |
191 double* selected_width) const; | 184 double* selected_width) const; |
192 | 185 |
193 // Returns the exact (unrounded) desired width of each tab, based on the | 186 // Returns the exact (unrounded) desired width of each tab, based on the |
194 // desired strip width and number of tabs. If | 187 // desired strip width and number of tabs. If |
195 // |width_of_tabs_for_mouse_close_| is nonnegative we use that value in | 188 // |width_of_tabs_for_mouse_close_| is nonnegative we use that value in |
196 // calculating the desired strip width; otherwise we use the current width. | 189 // calculating the desired strip width; otherwise we use the current width. |
197 // |mini_tab_count| gives the number of mini-tabs, |nano_tab_count| the | 190 // |mini_tab_count| gives the number of mini-tabs and |tab_count| the number |
198 // number of mini-tabs and |tab_count| the number of mini and non-mini-tabs. | 191 // of mini and non-mini-tabs. |
199 void GetDesiredTabWidths(int tab_count, | 192 void GetDesiredTabWidths(int tab_count, |
200 int mini_tab_count, | 193 int mini_tab_count, |
201 int nano_tab_count, | |
202 double* unselected_width, | 194 double* unselected_width, |
203 double* selected_width) const; | 195 double* selected_width) const; |
204 | 196 |
205 // Perform an animated resize-relayout of the TabStrip immediately. | 197 // Perform an animated resize-relayout of the TabStrip immediately. |
206 void ResizeLayoutTabs(); | 198 void ResizeLayoutTabs(); |
207 | 199 |
208 // Returns whether or not the cursor is currently in the "tab strip zone" | 200 // Returns whether or not the cursor is currently in the "tab strip zone" |
209 // which is defined as the region above the TabStrip and a bit below it. | 201 // which is defined as the region above the TabStrip and a bit below it. |
210 bool IsCursorInTabStripZone() const; | 202 bool IsCursorInTabStripZone() const; |
211 | 203 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // Used for stage 1 of new tab animation. | 312 // Used for stage 1 of new tab animation. |
321 base::OneShotTimer<TabStrip> new_tab_timer_; | 313 base::OneShotTimer<TabStrip> new_tab_timer_; |
322 | 314 |
323 // Whether the new tab button is being displayed. | 315 // Whether the new tab button is being displayed. |
324 bool new_tab_button_enabled_; | 316 bool new_tab_button_enabled_; |
325 | 317 |
326 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 318 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
327 }; | 319 }; |
328 | 320 |
329 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ | 321 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |