OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_VIEWS_TABS_BROWSER_TAB_STRIP_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TABS_BROWSER_TAB_STRIP_H_ |
| 7 |
| 8 #include "chrome/browser/views/tabs/tab_strip_2.h" |
| 9 #include "chrome/browser/tabs/tab_strip_model.h" |
| 10 |
| 11 // A specialization fo TabStrip2 for the browser window. |
| 12 // |
| 13 // TODO(beng): This shouldn't be a subclass of TabStrip2, rather it should own |
| 14 // one. |
| 15 class BrowserTabStrip : public TabStrip2, |
| 16 public TabStrip2Model, |
| 17 public TabStripModelObserver { |
| 18 public: |
| 19 explicit BrowserTabStrip(TabStripModel* model); |
| 20 virtual ~BrowserTabStrip(); |
| 21 |
| 22 // Detaches the tab at the specified index. |
| 23 TabContents* DetachTab(int index); |
| 24 |
| 25 // Attaches the specified TabContents at the appropriate position given the |
| 26 // mouse cursor at the specified screen position. |
| 27 void AttachTab(TabContents* contents, const gfx::Point& screen_point, |
| 28 const gfx::Rect& tab_screen_bounds); |
| 29 |
| 30 // Overridden from TabStripModelObserver: |
| 31 virtual void TabInsertedAt(TabContents* contents, |
| 32 int index, |
| 33 bool foreground); |
| 34 virtual void TabDetachedAt(TabContents* contents, int index); |
| 35 virtual void TabSelectedAt(TabContents* old_contents, |
| 36 TabContents* contents, |
| 37 int index, |
| 38 bool user_gesture); |
| 39 virtual void TabMoved(TabContents* contents, int from_index, int to_index); |
| 40 virtual void TabChangedAt(TabContents* contents, int index); |
| 41 |
| 42 // Overridden from TabStrip2Model: |
| 43 virtual string16 GetTitle(int index) const; |
| 44 virtual bool IsSelected(int index) const; |
| 45 virtual void SelectTabAt(int index); |
| 46 virtual bool CanDragTabs() const; |
| 47 virtual void MoveTabAt(int index, int to_index); |
| 48 virtual void DetachTabAt(int index, |
| 49 const gfx::Rect& window_bounds, |
| 50 const gfx::Rect& tab_bounds); |
| 51 |
| 52 private: |
| 53 TabStripModel* model_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(BrowserTabStrip); |
| 56 }; |
| 57 |
| 58 #endif // #ifndef CHROME_BROWSER_VIEWS_TABS_BROWSER_TAB_STRIP_H_ |
OLD | NEW |