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_TABS_TAB_STRIP_MODEL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // the TabStripModel (in our case the Browser object). | 35 // the TabStripModel (in our case the Browser object). |
36 // | 36 // |
37 /////////////////////////////////////////////////////////////////////////////// | 37 /////////////////////////////////////////////////////////////////////////////// |
38 class TabStripModelDelegate { | 38 class TabStripModelDelegate { |
39 public: | 39 public: |
40 enum { | 40 enum { |
41 TAB_MOVE_ACTION = 1, | 41 TAB_MOVE_ACTION = 1, |
42 TAB_TEAROFF_ACTION = 2 | 42 TAB_TEAROFF_ACTION = 2 |
43 }; | 43 }; |
44 | 44 |
| 45 virtual ~TabStripModelDelegate() {} |
| 46 |
45 // Adds what the delegate considers to be a blank tab to the model. | 47 // Adds what the delegate considers to be a blank tab to the model. |
46 virtual TabContents* AddBlankTab(bool foreground) = 0; | 48 virtual TabContents* AddBlankTab(bool foreground) = 0; |
47 virtual TabContents* AddBlankTabAt(int index, bool foreground) = 0; | 49 virtual TabContents* AddBlankTabAt(int index, bool foreground) = 0; |
48 | 50 |
49 // Asks for a new TabStripModel to be created and the given tab contents to | 51 // Asks for a new TabStripModel to be created and the given tab contents to |
50 // be added to it. Its size and position are reflected in |window_bounds|. | 52 // be added to it. Its size and position are reflected in |window_bounds|. |
51 // If |dock_info|'s type is other than NONE, the newly created window should | 53 // If |dock_info|'s type is other than NONE, the newly created window should |
52 // be docked as identified by |dock_info|. Returns the Browser object | 54 // be docked as identified by |dock_info|. Returns the Browser object |
53 // representing the newly created window and tab strip. This does not | 55 // representing the newly created window and tab strip. This does not |
54 // show the window, it's up to the caller to do so. | 56 // show the window, it's up to the caller to do so. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 102 |
101 // Restores the last closed tab if CanRestoreTab would return true. | 103 // Restores the last closed tab if CanRestoreTab would return true. |
102 virtual void RestoreTab() = 0; | 104 virtual void RestoreTab() = 0; |
103 | 105 |
104 // Returns true if we should allow "bookmark all tabs" in this window; this is | 106 // Returns true if we should allow "bookmark all tabs" in this window; this is |
105 // true when there is more than one bookmarkable tab open. | 107 // true when there is more than one bookmarkable tab open. |
106 virtual bool CanBookmarkAllTabs() const = 0; | 108 virtual bool CanBookmarkAllTabs() const = 0; |
107 | 109 |
108 // Creates a bookmark folder containing a bookmark for all open tabs. | 110 // Creates a bookmark folder containing a bookmark for all open tabs. |
109 virtual void BookmarkAllTabs() = 0; | 111 virtual void BookmarkAllTabs() = 0; |
110 | |
111 protected: | |
112 virtual ~TabStripModelDelegate() {} | |
113 }; | 112 }; |
114 | 113 |
115 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_ | 114 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_ |
OLD | NEW |