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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // - It takes part in Tab Drag & Drop with Tab, TabDragHelper and | 44 // - It takes part in Tab Drag & Drop with Tab, TabDragHelper and |
45 // DraggedTab, focusing on tasks that require reshuffling other tabs | 45 // DraggedTab, focusing on tasks that require reshuffling other tabs |
46 // in response to dragged tabs. | 46 // in response to dragged tabs. |
47 // | 47 // |
48 /////////////////////////////////////////////////////////////////////////////// | 48 /////////////////////////////////////////////////////////////////////////////// |
49 class TabStrip : public AbstractTabStripView, | 49 class TabStrip : public AbstractTabStripView, |
50 public views::ButtonListener, | 50 public views::ButtonListener, |
51 public views::MouseWatcherListener, | 51 public views::MouseWatcherListener, |
52 public TabController { | 52 public TabController { |
53 public: | 53 public: |
| 54 static const char kViewClassName[]; |
| 55 |
54 explicit TabStrip(TabStripController* controller); | 56 explicit TabStrip(TabStripController* controller); |
55 virtual ~TabStrip(); | 57 virtual ~TabStrip(); |
56 | 58 |
57 // Returns the bounds of the new tab button. | 59 // Returns the bounds of the new tab button. |
58 gfx::Rect GetNewTabButtonBounds(); | 60 gfx::Rect GetNewTabButtonBounds(); |
59 | 61 |
60 // Returns true if the new tab button should be sized to the top of the tab | 62 // Returns true if the new tab button should be sized to the top of the tab |
61 // strip. | 63 // strip. |
62 bool SizeTabButtonToTopOfTabStrip(); | 64 bool SizeTabButtonToTopOfTabStrip(); |
63 | 65 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 virtual bool IsTabStripEditable() const OVERRIDE; | 161 virtual bool IsTabStripEditable() const OVERRIDE; |
160 virtual bool IsTabStripCloseable() const OVERRIDE; | 162 virtual bool IsTabStripCloseable() const OVERRIDE; |
161 virtual void UpdateLoadingAnimations() OVERRIDE; | 163 virtual void UpdateLoadingAnimations() OVERRIDE; |
162 virtual bool IsPositionInWindowCaption(const gfx::Point& point) OVERRIDE; | 164 virtual bool IsPositionInWindowCaption(const gfx::Point& point) OVERRIDE; |
163 virtual void SetBackgroundOffset(const gfx::Point& offset) OVERRIDE; | 165 virtual void SetBackgroundOffset(const gfx::Point& offset) OVERRIDE; |
164 virtual views::View* GetNewTabButton() OVERRIDE; | 166 virtual views::View* GetNewTabButton() OVERRIDE; |
165 | 167 |
166 // views::View overrides: | 168 // views::View overrides: |
167 virtual void Layout() OVERRIDE; | 169 virtual void Layout() OVERRIDE; |
168 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 170 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 171 virtual std::string GetClassName() const OVERRIDE; |
169 virtual gfx::Size GetPreferredSize() OVERRIDE; | 172 virtual gfx::Size GetPreferredSize() OVERRIDE; |
170 // NOTE: the drag and drop methods are invoked from FrameView. This is done | 173 // NOTE: the drag and drop methods are invoked from FrameView. This is done |
171 // to allow for a drop region that extends outside the bounds of the TabStrip. | 174 // to allow for a drop region that extends outside the bounds of the TabStrip. |
172 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; | 175 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; |
173 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; | 176 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; |
174 virtual void OnDragExited() OVERRIDE; | 177 virtual void OnDragExited() OVERRIDE; |
175 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; | 178 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; |
176 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 179 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
177 virtual views::View* GetEventHandlerForPoint( | 180 virtual views::View* GetEventHandlerForPoint( |
178 const gfx::Point& point) OVERRIDE; | 181 const gfx::Point& point) OVERRIDE; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // rest are compresses on the left/right edge. | 513 // rest are compresses on the left/right edge. |
511 int num_visible_tabs_; | 514 int num_visible_tabs_; |
512 | 515 |
513 // Are we in stacking/scrolling mode? | 516 // Are we in stacking/scrolling mode? |
514 bool stacking_; | 517 bool stacking_; |
515 | 518 |
516 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 519 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
517 }; | 520 }; |
518 | 521 |
519 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 522 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |