Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/views/tabs/side_tab_strip.h

Issue 1141005: Revert r42156, r42157, r42160. Allow dynamic switching in and out of sidetabs... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/tabs/side_tab.cc ('k') | chrome/browser/views/tabs/side_tab_strip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_SIDE_TAB_STRIP_H_ 5 #ifndef CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_
6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ 6 #define CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_
7 7
8 #include "chrome/browser/tabs/tab_strip_model.h" 8 #include "chrome/browser/tabs/tab_strip_model.h"
9 #include "chrome/browser/views/tabs/base_tab_strip.h" 9 #include "chrome/browser/views/tabs/base_tab_strip.h"
10 #include "chrome/browser/views/tabs/side_tab.h" 10 #include "chrome/browser/views/tabs/side_tab.h"
11 11
12 class Profile; 12 class Profile;
13 class SideTabStripModel; 13 class SideTabStripModel;
14 14
15 class SideTabStrip : public BaseTabStrip, 15 class SideTabStrip : public BaseTabStrip,
16 public SideTabModel { 16 public SideTabModel {
17 public: 17 public:
18 SideTabStrip(); 18 SideTabStrip();
19 virtual ~SideTabStrip(); 19 virtual ~SideTabStrip();
20 20
21 // Associate a model with this SideTabStrip. The SideTabStrip owns its model. 21 // Associate a model with this SideTabStrip. The SideTabStrip owns its model.
22 void SetModel(SideTabStripModel* model); 22 void SetModel(SideTabStripModel* model);
23 23
24 // Whether or not the browser has been run with the "enable-vertical-tabs" 24 // Whether or not the browser has been run with the "enable-vertical-tabs"
25 // command line flag that allows the SideTabStrip to be optionally shown. 25 // command line flag that allows the SideTabStrip to be optionally shown.
26 static bool Available(); 26 static bool Available();
27 27
28 // Whether or not the vertical tabstrip is shown. Only valid if Available()
29 // returns true.
30 static bool Visible(Profile* profile);
31
28 // Notifies the SideTabStrip that a tab was added in the model at |index|. 32 // Notifies the SideTabStrip that a tab was added in the model at |index|.
29 void AddTabAt(int index); 33 void AddTabAt(int index);
30 34
31 // Notifies the SideTabStrip that a tab was removed from the model at |index|. 35 // Notifies the SideTabStrip that a tab was removed from the model at |index|.
32 void RemoveTabAt(int index); 36 void RemoveTabAt(int index);
33 37
34 // Notifies the SideTabStrip that a tab was selected in the model at |index|. 38 // Notifies the SideTabStrip that a tab was selected in the model at |index|.
35 void SelectTabAt(int index); 39 void SelectTabAt(int index);
36 40
37 // Notifies the SideTabStrip that the tab at |index| needs to be redisplayed 41 // Notifies the SideTabStrip that the tab at |index| needs to be redisplayed
38 // since some of its metadata has changed. 42 // since some of its metadata has changed.
39 void UpdateTabAt(int index); 43 void UpdateTabAt(int index);
40 44
41 // SideTabModel implementation: 45 // SideTabModel implementation:
42 virtual string16 GetTitle(SideTab* tab) const; 46 virtual string16 GetTitle(SideTab* tab) const;
43 virtual SkBitmap GetIcon(SideTab* tab) const; 47 virtual SkBitmap GetIcon(SideTab* tab) const;
44 virtual bool IsSelected(SideTab* tab) const; 48 virtual bool IsSelected(SideTab* tab) const;
45 virtual void SelectTab(SideTab* tab); 49 virtual void SelectTab(SideTab* tab);
46 virtual void CloseTab(SideTab* tab); 50 virtual void CloseTab(SideTab* tab);
47 virtual void ShowContextMenu(SideTab* tab, const gfx::Point& p);
48 51
49 // BaseTabStrip implementation: 52 // BaseTabStrip implementation:
50 virtual int GetPreferredHeight(); 53 virtual int GetPreferredHeight();
51 virtual void SetBackgroundOffset(const gfx::Point& offset); 54 virtual void SetBackgroundOffset(const gfx::Point& offset);
52 virtual bool IsPositionInWindowCaption(const gfx::Point& point); 55 virtual bool IsPositionInWindowCaption(const gfx::Point& point);
53 virtual void SetDraggedTabBounds(int tab_index, 56 virtual void SetDraggedTabBounds(int tab_index,
54 const gfx::Rect& tab_bounds); 57 const gfx::Rect& tab_bounds);
55 virtual bool IsDragSessionActive() const; 58 virtual bool IsDragSessionActive() const;
56 virtual void UpdateLoadingAnimations(); 59 virtual void UpdateLoadingAnimations();
57 virtual bool IsAnimating() const; 60 virtual bool IsAnimating() const;
58 virtual TabStrip* AsTabStrip(); 61 virtual TabStrip* AsTabStrip();
59 62
60 // views::View overrides: 63 // views::View overrides:
61 virtual void Layout(); 64 virtual void Layout();
62 virtual gfx::Size GetPreferredSize(); 65 virtual gfx::Size GetPreferredSize();
63 66
64 private: 67 private:
65 // Returns the model index of the specified |tab|. 68 // Returns the model index of the specified |tab|.
66 int GetIndexOfSideTab(SideTab* tab) const; 69 int GetIndexOfSideTab(SideTab* tab) const;
67 70
68 // Returns the SideTab at the specified |index|. 71 // Returns the SideTab at the specified |index|.
69 SideTab* GetSideTabAt(int index) const; 72 SideTab* GetSideTabAt(int index) const;
70 73
71 scoped_ptr<SideTabStripModel> model_; 74 scoped_ptr<SideTabStripModel> model_;
72 75
73 DISALLOW_COPY_AND_ASSIGN(SideTabStrip); 76 DISALLOW_COPY_AND_ASSIGN(SideTabStrip);
74 }; 77 };
75 78
76 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_ 79 #endif // CHROME_BROWSER_VIEWS_TABS_SIDE_TAB_STRIP_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/side_tab.cc ('k') | chrome/browser/views/tabs/side_tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698