| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/gfx/point.h" | 8 #include "base/gfx/point.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/tabs/tab_strip_model.h" | 10 #include "chrome/browser/tabs/tab_strip_model.h" |
| 11 #include "chrome/browser/views/tabs/tab.h" | 11 #include "chrome/browser/views/tabs/tab.h" |
| 12 #include "chrome/browser/views/tabs/tab_strip_wrapper.h" | 12 #include "chrome/browser/views/tabs/tab_strip_wrapper.h" |
| 13 #include "views/controls/button/image_button.h" | 13 #include "views/controls/button/image_button.h" |
| 14 #include "views/view.h" | 14 #include "views/view.h" |
| 15 | 15 |
| 16 class BrowserExtender; |
| 16 class DraggedTabController; | 17 class DraggedTabController; |
| 17 class ScopedMouseCloseWidthCalculator; | 18 class ScopedMouseCloseWidthCalculator; |
| 18 class TabStripModel; | 19 class TabStripModel; |
| 19 | 20 |
| 20 namespace views { | 21 namespace views { |
| 21 class ImageView; | 22 class ImageView; |
| 22 #if defined(OS_LINUX) | 23 #if defined(OS_LINUX) |
| 23 class WidgetGtk; | 24 class WidgetGtk; |
| 24 #elif defined(OS_WIN) | 25 #elif defined(OS_WIN) |
| 25 class WidgetWin; | 26 class WidgetWin; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 48 public: | 49 public: |
| 49 explicit TabStrip(TabStripModel* model); | 50 explicit TabStrip(TabStripModel* model); |
| 50 virtual ~TabStrip(); | 51 virtual ~TabStrip(); |
| 51 | 52 |
| 52 // Returns true if the TabStrip can accept input events. This returns false | 53 // Returns true if the TabStrip can accept input events. This returns false |
| 53 // when the TabStrip is animating to a new state and as such the user should | 54 // when the TabStrip is animating to a new state and as such the user should |
| 54 // not be allowed to interact with the TabStrip. | 55 // not be allowed to interact with the TabStrip. |
| 55 bool CanProcessInputEvents() const; | 56 bool CanProcessInputEvents() const; |
| 56 | 57 |
| 57 // Accessors for the model and individual Tabs. | 58 // Accessors for the model and individual Tabs. |
| 58 TabStripModel* model() { return model_; } | 59 TabStripModel* model() const { return model_; } |
| 59 | 60 |
| 60 // Destroys the active drag controller. | 61 // Destroys the active drag controller. |
| 61 void DestroyDragController(); | 62 void DestroyDragController(); |
| 62 | 63 |
| 63 // Removes the drag source Tab from this TabStrip, and deletes it. | 64 // Removes the drag source Tab from this TabStrip, and deletes it. |
| 64 void DestroyDraggedSourceTab(Tab* tab); | 65 void DestroyDraggedSourceTab(Tab* tab); |
| 65 | 66 |
| 66 // Retrieve the ideal bounds for the Tab at the specified index. | 67 // Retrieve the ideal bounds for the Tab at the specified index. |
| 67 gfx::Rect GetIdealBounds(int index); | 68 gfx::Rect GetIdealBounds(int index); |
| 68 | 69 |
| 70 // Returns the currently selected tab. |
| 71 Tab* GetSelectedTab() const; |
| 72 |
| 69 // Create the new tab button. | 73 // Create the new tab button. |
| 70 void InitTabStripButtons(); | 74 void InitTabStripButtons(); |
| 71 | 75 |
| 72 // views::View overrides: | 76 // views::View overrides: |
| 73 virtual void PaintChildren(gfx::Canvas* canvas); | 77 virtual void PaintChildren(gfx::Canvas* canvas); |
| 74 virtual views::View* GetViewByID(int id) const; | 78 virtual views::View* GetViewByID(int id) const; |
| 75 virtual void Layout(); | 79 virtual void Layout(); |
| 76 virtual gfx::Size GetPreferredSize(); | 80 virtual gfx::Size GetPreferredSize(); |
| 77 // NOTE: the drag and drop methods are invoked from FrameView. This is done to | 81 // NOTE: the drag and drop methods are invoked from FrameView. This is done to |
| 78 // allow for a drop region that extends outside the bounds of the TabStrip. | 82 // allow for a drop region that extends outside the bounds of the TabStrip. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 }; | 393 }; |
| 390 std::vector<TabData> tab_data_; | 394 std::vector<TabData> tab_data_; |
| 391 | 395 |
| 392 // The currently running animation. | 396 // The currently running animation. |
| 393 scoped_ptr<TabAnimation> active_animation_; | 397 scoped_ptr<TabAnimation> active_animation_; |
| 394 | 398 |
| 395 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 399 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
| 396 }; | 400 }; |
| 397 | 401 |
| 398 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ | 402 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_STRIP_H_ |
| OLD | NEW |