| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 static const char kViewClassName[]; | 59 static const char kViewClassName[]; |
| 60 | 60 |
| 61 // Horizontal offset for the new tab button to bring it closer to the | 61 // Horizontal offset for the new tab button to bring it closer to the |
| 62 // rightmost tab. | 62 // rightmost tab. |
| 63 static const int kNewTabButtonHorizontalOffset; | 63 static const int kNewTabButtonHorizontalOffset; |
| 64 | 64 |
| 65 // The vertical offset of the tab strip button. This offset applies only to | 65 // The vertical offset of the tab strip button. This offset applies only to |
| 66 // restored windows. | 66 // restored windows. |
| 67 static const int kNewTabButtonVerticalOffset; | 67 static const int kNewTabButtonVerticalOffset; |
| 68 | 68 |
| 69 // The size of the new tab button must be hardcoded because we need to be |
| 70 // able to lay it out before we are able to get its image from the |
| 71 // ui::ThemeProvider. It also makes sense to do this, because the size of the |
| 72 // new tab button should not need to be calculated dynamically. |
| 73 static const int kNewTabButtonAssetWidth; |
| 74 static const int kNewTabButtonAssetHeight; |
| 75 |
| 69 explicit TabStrip(TabStripController* controller); | 76 explicit TabStrip(TabStripController* controller); |
| 70 virtual ~TabStrip(); | 77 virtual ~TabStrip(); |
| 71 | 78 |
| 72 // Add and remove observers to changes within this TabStrip. | 79 // Add and remove observers to changes within this TabStrip. |
| 73 void AddObserver(TabStripObserver* observer); | 80 void AddObserver(TabStripObserver* observer); |
| 74 void RemoveObserver(TabStripObserver* observer); | 81 void RemoveObserver(TabStripObserver* observer); |
| 75 | 82 |
| 76 // If |adjust_layout| is true the stacked layout changes based on whether the | 83 // If |adjust_layout| is true the stacked layout changes based on whether the |
| 77 // user uses a mouse or a touch device with the tabstrip. | 84 // user uses a mouse or a touch device with the tabstrip. |
| 78 void set_adjust_layout(bool adjust_layout) { adjust_layout_ = adjust_layout; } | 85 void set_adjust_layout(bool adjust_layout) { adjust_layout_ = adjust_layout; } |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // Whether the MIME type of the file pointed to by |url| is supported. | 310 // Whether the MIME type of the file pointed to by |url| is supported. |
| 304 bool file_supported; | 311 bool file_supported; |
| 305 | 312 |
| 306 private: | 313 private: |
| 307 DISALLOW_COPY_AND_ASSIGN(DropInfo); | 314 DISALLOW_COPY_AND_ASSIGN(DropInfo); |
| 308 }; | 315 }; |
| 309 | 316 |
| 310 // Horizontal gap between mini and non-mini-tabs. | 317 // Horizontal gap between mini and non-mini-tabs. |
| 311 static const int kMiniToNonMiniGap; | 318 static const int kMiniToNonMiniGap; |
| 312 | 319 |
| 313 // The size of the new tab button must be hardcoded because we need to be | |
| 314 // able to lay it out before we are able to get its image from the | |
| 315 // ui::ThemeProvider. It also makes sense to do this, because the size of the | |
| 316 // new tab button should not need to be calculated dynamically. | |
| 317 static const int kNewTabButtonAssetWidth; | |
| 318 static const int kNewTabButtonAssetHeight; | |
| 319 | |
| 320 void Init(); | 320 void Init(); |
| 321 | 321 |
| 322 // Creates and returns a new tab. The caller owners the returned tab. | 322 // Creates and returns a new tab. The caller owners the returned tab. |
| 323 Tab* CreateTab(); | 323 Tab* CreateTab(); |
| 324 | 324 |
| 325 // Invoked from |AddTabAt| after the newly created tab has been inserted. | 325 // Invoked from |AddTabAt| after the newly created tab has been inserted. |
| 326 void StartInsertTabAnimation(int model_index); | 326 void StartInsertTabAnimation(int model_index); |
| 327 | 327 |
| 328 // Invoked from |MoveTab| after |tab_data_| has been updated to animate the | 328 // Invoked from |MoveTab| after |tab_data_| has been updated to animate the |
| 329 // move. | 329 // move. |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 bool immersive_style_; | 678 bool immersive_style_; |
| 679 | 679 |
| 680 // Our observers. | 680 // Our observers. |
| 681 typedef ObserverList<TabStripObserver> TabStripObservers; | 681 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 682 TabStripObservers observers_; | 682 TabStripObservers observers_; |
| 683 | 683 |
| 684 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 684 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 685 }; | 685 }; |
| 686 | 686 |
| 687 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 687 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |