OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
| 10 #include <deque> |
| 11 #include <map> |
| 12 |
10 #include "base/scoped_nsobject.h" | 13 #include "base/scoped_nsobject.h" |
11 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
12 #import "chrome/browser/cocoa/tab_controller_target.h" | 15 #import "chrome/browser/cocoa/tab_controller_target.h" |
13 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" | 16 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" |
14 | 17 |
15 @class TabView; | 18 @class TabView; |
16 @class TabStripView; | 19 @class TabStripView; |
17 | 20 |
18 class Browser; | 21 class Browser; |
19 class ConstrainedWindowMac; | 22 class ConstrainedWindowMac; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 92 |
90 // Array of subviews which are permanent (and which should never be removed), | 93 // Array of subviews which are permanent (and which should never be removed), |
91 // such as the new-tab button, but *not* the tabs themselves. | 94 // such as the new-tab button, but *not* the tabs themselves. |
92 scoped_nsobject<NSMutableArray> permanentSubviews_; | 95 scoped_nsobject<NSMutableArray> permanentSubviews_; |
93 | 96 |
94 // The default favicon, so we can use one copy for all buttons. | 97 // The default favicon, so we can use one copy for all buttons. |
95 scoped_nsobject<NSImage> defaultFavIcon_; | 98 scoped_nsobject<NSImage> defaultFavIcon_; |
96 | 99 |
97 // Manages per-tab sheets. | 100 // Manages per-tab sheets. |
98 scoped_nsobject<GTMWindowSheetController> sheetController_; | 101 scoped_nsobject<GTMWindowSheetController> sheetController_; |
| 102 |
| 103 // GTMWindowSheetController supports only one per-tab sheet at a time. |
| 104 // Thus, keep a queue of sheets for every tab. The first element in the queue |
| 105 // is the currently visible sheet, and when this sheet is closed, the next |
| 106 // sheet in the queue will be shown. |
| 107 std::map<NSView*, std::deque<ConstrainedWindowMac*> > constrainedWindows_; |
99 } | 108 } |
100 | 109 |
101 // Initialize the controller with a view and browser that contains | 110 // Initialize the controller with a view and browser that contains |
102 // everything else we'll need. |switchView| is the view whose contents get | 111 // everything else we'll need. |switchView| is the view whose contents get |
103 // "switched" every time the user switches tabs. The children of this view | 112 // "switched" every time the user switches tabs. The children of this view |
104 // will be released, so if you want them to stay around, make sure | 113 // will be released, so if you want them to stay around, make sure |
105 // you have retained them. | 114 // you have retained them. |
106 - (id)initWithView:(TabStripView*)view | 115 - (id)initWithView:(TabStripView*)view |
107 switchView:(NSView*)switchView | 116 switchView:(NSView*)switchView |
108 browser:(Browser*)browser; | 117 browser:(Browser*)browser; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // For example, this returns NO if there are any pending tab close animtations. | 171 // For example, this returns NO if there are any pending tab close animtations. |
163 - (BOOL)tabDraggingAllowed; | 172 - (BOOL)tabDraggingAllowed; |
164 | 173 |
165 // Default height for tabs. | 174 // Default height for tabs. |
166 + (CGFloat)defaultTabHeight; | 175 + (CGFloat)defaultTabHeight; |
167 | 176 |
168 // Returns the (lazily created) window sheet controller of this window. Used | 177 // Returns the (lazily created) window sheet controller of this window. Used |
169 // for the per-tab sheets. | 178 // for the per-tab sheets. |
170 - (GTMWindowSheetController*)sheetController; | 179 - (GTMWindowSheetController*)sheetController; |
171 | 180 |
172 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; | 181 // See comments in browser_window_controller.h for documentation about these |
| 182 // functions. |
| 183 - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window; |
173 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; | 184 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; |
174 | 185 |
175 @end | 186 @end |
176 | 187 |
177 // Notification sent when the number of tabs changes. The object will be this | 188 // Notification sent when the number of tabs changes. The object will be this |
178 // controller. | 189 // controller. |
179 extern NSString* const kTabStripNumberOfTabsChanged; | 190 extern NSString* const kTabStripNumberOfTabsChanged; |
180 | 191 |
181 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ | 192 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |