| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 // Set the background offset used by inactive tabs to match the frame image. | 164 // Set the background offset used by inactive tabs to match the frame image. |
| 165 void SetBackgroundOffset(const gfx::Point& offset); | 165 void SetBackgroundOffset(const gfx::Point& offset); |
| 166 | 166 |
| 167 // Returns the new tab button. This is never NULL. | 167 // Returns the new tab button. This is never NULL. |
| 168 views::View* newtab_button(); | 168 views::View* newtab_button(); |
| 169 | 169 |
| 170 // Sets a painting style with miniature "tab indicator" rectangles at the top. | 170 // Sets a painting style with miniature "tab indicator" rectangles at the top. |
| 171 void SetImmersiveStyle(bool enable); | 171 void SetImmersiveStyle(bool enable); |
| 172 | 172 |
| 173 // Returns true if Tabs in this TabStrip are currently changing size or |
| 174 // position. |
| 175 bool IsAnimating() const; |
| 176 |
| 177 // Stops any ongoing animations. If |layout| is true and an animation is |
| 178 // ongoing this does a layout. |
| 179 void StopAnimating(bool layout); |
| 180 |
| 173 // TabController overrides: | 181 // TabController overrides: |
| 174 virtual const ui::ListSelectionModel& GetSelectionModel() OVERRIDE; | 182 virtual const ui::ListSelectionModel& GetSelectionModel() OVERRIDE; |
| 175 virtual bool SupportsMultipleSelection() OVERRIDE; | 183 virtual bool SupportsMultipleSelection() OVERRIDE; |
| 176 virtual void SelectTab(Tab* tab) OVERRIDE; | 184 virtual void SelectTab(Tab* tab) OVERRIDE; |
| 177 virtual void ExtendSelectionTo(Tab* tab) OVERRIDE; | 185 virtual void ExtendSelectionTo(Tab* tab) OVERRIDE; |
| 178 virtual void ToggleSelected(Tab* tab) OVERRIDE; | 186 virtual void ToggleSelected(Tab* tab) OVERRIDE; |
| 179 virtual void AddSelectionFromAnchorTo(Tab* tab) OVERRIDE; | 187 virtual void AddSelectionFromAnchorTo(Tab* tab) OVERRIDE; |
| 180 virtual void CloseTab(Tab* tab, CloseTabSource source) OVERRIDE; | 188 virtual void CloseTab(Tab* tab, CloseTabSource source) OVERRIDE; |
| 181 virtual void ShowContextMenuForTab(Tab* tab, | 189 virtual void ShowContextMenuForTab(Tab* tab, |
| 182 const gfx::Point& p) OVERRIDE; | 190 const gfx::Point& p) OVERRIDE; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // move. | 302 // move. |
| 295 void StartMoveTabAnimation(); | 303 void StartMoveTabAnimation(); |
| 296 | 304 |
| 297 // Starts the remove tab animation. | 305 // Starts the remove tab animation. |
| 298 void StartRemoveTabAnimation(int model_index); | 306 void StartRemoveTabAnimation(int model_index); |
| 299 | 307 |
| 300 // Schedules the animations and bounds changes necessary for a remove tab | 308 // Schedules the animations and bounds changes necessary for a remove tab |
| 301 // animation. | 309 // animation. |
| 302 void ScheduleRemoveTabAnimation(Tab* tab); | 310 void ScheduleRemoveTabAnimation(Tab* tab); |
| 303 | 311 |
| 304 // Stops any ongoing animations. If |layout| is true and an animation is | |
| 305 // ongoing this does a layout. | |
| 306 void StopAnimating(bool layout); | |
| 307 | |
| 308 // Animates all the views to their ideal bounds. | 312 // Animates all the views to their ideal bounds. |
| 309 // NOTE: this does *not* invoke GenerateIdealBounds, it uses the bounds | 313 // NOTE: this does *not* invoke GenerateIdealBounds, it uses the bounds |
| 310 // currently set in ideal_bounds. | 314 // currently set in ideal_bounds. |
| 311 void AnimateToIdealBounds(); | 315 void AnimateToIdealBounds(); |
| 312 | 316 |
| 313 // Returns whether the highlight button should be highlighted after a remove. | 317 // Returns whether the highlight button should be highlighted after a remove. |
| 314 bool ShouldHighlightCloseButtonAfterRemove(); | 318 bool ShouldHighlightCloseButtonAfterRemove(); |
| 315 | 319 |
| 316 // Invoked from Layout if the size changes or layout is really needed. | 320 // Invoked from Layout if the size changes or layout is really needed. |
| 317 void DoLayout(); | 321 void DoLayout(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // Returns the drop effect for dropping a URL on the tab strip. This does | 452 // Returns the drop effect for dropping a URL on the tab strip. This does |
| 449 // not query the data in anyway, it only looks at the source operations. | 453 // not query the data in anyway, it only looks at the source operations. |
| 450 int GetDropEffect(const ui::DropTargetEvent& event); | 454 int GetDropEffect(const ui::DropTargetEvent& event); |
| 451 | 455 |
| 452 // Returns the image to use for indicating a drop on a tab. If is_down is | 456 // Returns the image to use for indicating a drop on a tab. If is_down is |
| 453 // true, this returns an arrow pointing down. | 457 // true, this returns an arrow pointing down. |
| 454 static gfx::ImageSkia* GetDropArrowImage(bool is_down); | 458 static gfx::ImageSkia* GetDropArrowImage(bool is_down); |
| 455 | 459 |
| 456 // -- Animations ------------------------------------------------------------ | 460 // -- Animations ------------------------------------------------------------ |
| 457 | 461 |
| 458 // Returns true if Tabs in this TabStrip are currently changing size or | |
| 459 // position. | |
| 460 bool IsAnimating() const; | |
| 461 | |
| 462 // Invoked prior to starting a new animation. | 462 // Invoked prior to starting a new animation. |
| 463 void PrepareForAnimation(); | 463 void PrepareForAnimation(); |
| 464 | 464 |
| 465 // Generates the ideal bounds for each of the tabs as well as the new tab | 465 // Generates the ideal bounds for each of the tabs as well as the new tab |
| 466 // button. | 466 // button. |
| 467 void GenerateIdealBounds(); | 467 void GenerateIdealBounds(); |
| 468 | 468 |
| 469 // Generates the ideal bounds for the mini tabs. Returns the index to position | 469 // Generates the ideal bounds for the mini tabs. Returns the index to position |
| 470 // the first non-mini tab and sets |first_non_mini_index| to the index of the | 470 // the first non-mini tab and sets |first_non_mini_index| to the index of the |
| 471 // first non-mini tab. | 471 // first non-mini tab. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 bool immersive_style_; | 604 bool immersive_style_; |
| 605 | 605 |
| 606 // Our observers. | 606 // Our observers. |
| 607 typedef ObserverList<TabStripObserver> TabStripObservers; | 607 typedef ObserverList<TabStripObserver> TabStripObservers; |
| 608 TabStripObservers observers_; | 608 TabStripObservers observers_; |
| 609 | 609 |
| 610 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 610 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 611 }; | 611 }; |
| 612 | 612 |
| 613 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 613 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |