| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 scoped_nsobject<CrTrackingArea> trackingArea_; | 133 scoped_nsobject<CrTrackingArea> trackingArea_; |
| 134 TabView* hoveredTab_; // weak. Tab that the mouse is hovering over | 134 TabView* hoveredTab_; // weak. Tab that the mouse is hovering over |
| 135 | 135 |
| 136 // Array of subviews which are permanent (and which should never be removed), | 136 // Array of subviews which are permanent (and which should never be removed), |
| 137 // such as the new-tab button, but *not* the tabs themselves. | 137 // such as the new-tab button, but *not* the tabs themselves. |
| 138 scoped_nsobject<NSMutableArray> permanentSubviews_; | 138 scoped_nsobject<NSMutableArray> permanentSubviews_; |
| 139 | 139 |
| 140 // The default favicon, so we can use one copy for all buttons. | 140 // The default favicon, so we can use one copy for all buttons. |
| 141 scoped_nsobject<NSImage> defaultFavicon_; | 141 scoped_nsobject<NSImage> defaultFavicon_; |
| 142 | 142 |
| 143 // The amount by which to indent the tabs on the left (to make room for the | 143 // The amount by which to indent the tabs on the sides (to make room for the |
| 144 // red/yellow/green buttons). | 144 // red/yellow/green and incognito/fullscreen buttons). |
| 145 CGFloat indentForControls_; | 145 CGFloat leftIndentForControls_; |
| 146 CGFloat rightIndentForControls_; |
| 146 | 147 |
| 147 // Manages per-tab sheets. | 148 // Manages per-tab sheets. |
| 148 scoped_nsobject<GTMWindowSheetController> sheetController_; | 149 scoped_nsobject<GTMWindowSheetController> sheetController_; |
| 149 | 150 |
| 150 // Is the mouse currently inside the strip; | 151 // Is the mouse currently inside the strip; |
| 151 BOOL mouseInside_; | 152 BOOL mouseInside_; |
| 152 | 153 |
| 153 // Helper for performing tab selection as a result of dragging over a tab. | 154 // Helper for performing tab selection as a result of dragging over a tab. |
| 154 scoped_ptr<HoverTabSelector> hoverTabSelector_; | 155 scoped_ptr<HoverTabSelector> hoverTabSelector_; |
| 155 } | 156 } |
| 156 | 157 |
| 157 @property(nonatomic) CGFloat indentForControls; | 158 @property(nonatomic) CGFloat leftIndentForControls; |
| 159 @property(nonatomic) CGFloat rightIndentForControls; |
| 158 | 160 |
| 159 // Initialize the controller with a view and browser that contains | 161 // Initialize the controller with a view and browser that contains |
| 160 // everything else we'll need. |switchView| is the view whose contents get | 162 // everything else we'll need. |switchView| is the view whose contents get |
| 161 // "switched" every time the user switches tabs. The children of this view | 163 // "switched" every time the user switches tabs. The children of this view |
| 162 // will be released, so if you want them to stay around, make sure | 164 // will be released, so if you want them to stay around, make sure |
| 163 // you have retained them. | 165 // you have retained them. |
| 164 // |delegate| is the one listening to filtered TabStripModelObserverBridge's | 166 // |delegate| is the one listening to filtered TabStripModelObserverBridge's |
| 165 // events (see TabStripControllerDelegate for more details). | 167 // events (see TabStripControllerDelegate for more details). |
| 166 - (id)initWithView:(TabStripView*)view | 168 - (id)initWithView:(TabStripView*)view |
| 167 switchView:(NSView*)switchView | 169 switchView:(NSView*)switchView |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // of the window or the window decorations. Returns YES only if the entire tab | 221 // of the window or the window decorations. Returns YES only if the entire tab |
| 220 // is visible. | 222 // is visible. |
| 221 - (BOOL)isTabFullyVisible:(TabView*)tab; | 223 - (BOOL)isTabFullyVisible:(TabView*)tab; |
| 222 | 224 |
| 223 // Show or hide the new tab button. The button is hidden immediately, but | 225 // Show or hide the new tab button. The button is hidden immediately, but |
| 224 // waits until the next call to |-layoutTabs| to show it again. | 226 // waits until the next call to |-layoutTabs| to show it again. |
| 225 - (void)showNewTabButton:(BOOL)show; | 227 - (void)showNewTabButton:(BOOL)show; |
| 226 | 228 |
| 227 // Force the tabs to rearrange themselves to reflect the current model. | 229 // Force the tabs to rearrange themselves to reflect the current model. |
| 228 - (void)layoutTabs; | 230 - (void)layoutTabs; |
| 231 - (void)layoutTabsWithoutAnimation; |
| 229 | 232 |
| 230 // Are we in rapid (tab) closure mode? I.e., is a full layout deferred (while | 233 // Are we in rapid (tab) closure mode? I.e., is a full layout deferred (while |
| 231 // the user closes tabs)? Needed to overcome missing clicks during rapid tab | 234 // the user closes tabs)? Needed to overcome missing clicks during rapid tab |
| 232 // closure. | 235 // closure. |
| 233 - (BOOL)inRapidClosureMode; | 236 - (BOOL)inRapidClosureMode; |
| 234 | 237 |
| 235 // Returns YES if the user is allowed to drag tabs on the strip at this moment. | 238 // Returns YES if the user is allowed to drag tabs on the strip at this moment. |
| 236 // For example, this returns NO if there are any pending tab close animtations. | 239 // For example, this returns NO if there are any pending tab close animtations. |
| 237 - (BOOL)tabDraggingAllowed; | 240 - (BOOL)tabDraggingAllowed; |
| 238 | 241 |
| 239 // Default height for tabs. | 242 // Default height for tabs. |
| 240 + (CGFloat)defaultTabHeight; | 243 + (CGFloat)defaultTabHeight; |
| 241 | 244 |
| 242 // Default indentation for tabs (see |indentForControls_|). | 245 // Default indentation for tabs (see |leftIndentForControls_|). |
| 243 + (CGFloat)defaultIndentForControls; | 246 + (CGFloat)defaultLeftIndentForControls; |
| 244 | 247 |
| 245 // Returns the (lazily created) window sheet controller of this window. Used | 248 // Returns the (lazily created) window sheet controller of this window. Used |
| 246 // for the per-tab sheets. | 249 // for the per-tab sheets. |
| 247 - (GTMWindowSheetController*)sheetController; | 250 - (GTMWindowSheetController*)sheetController; |
| 248 | 251 |
| 249 // Destroys the window sheet controller of this window, if it exists. The sheet | 252 // Destroys the window sheet controller of this window, if it exists. The sheet |
| 250 // controller can be recreated by a subsequent call to |-sheetController|. Must | 253 // controller can be recreated by a subsequent call to |-sheetController|. Must |
| 251 // not be called if any sheets are currently open. | 254 // not be called if any sheets are currently open. |
| 252 // TODO(viettrungluu): This is temporary code needed to allow sheets to work | 255 // TODO(viettrungluu): This is temporary code needed to allow sheets to work |
| 253 // (read: not crash) in fullscreen mode. Once GTMWindowSheetController is | 256 // (read: not crash) in fullscreen mode. Once GTMWindowSheetController is |
| 254 // modified to support moving sheets between windows, this code can go away. | 257 // modified to support moving sheets between windows, this code can go away. |
| 255 // http://crbug.com/19093. | 258 // http://crbug.com/19093. |
| 256 - (void)destroySheetController; | 259 - (void)destroySheetController; |
| 257 | 260 |
| 258 // Returns the currently active TabContentsController. | 261 // Returns the currently active TabContentsController. |
| 259 - (TabContentsController*)activeTabContentsController; | 262 - (TabContentsController*)activeTabContentsController; |
| 260 | 263 |
| 261 // See comments in browser_window_controller.h for documentation about these | 264 // See comments in browser_window_controller.h for documentation about these |
| 262 // functions. | 265 // functions. |
| 263 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; | 266 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; |
| 264 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; | 267 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; |
| 265 | 268 |
| 266 @end | 269 @end |
| 267 | 270 |
| 268 // Notification sent when the number of tabs changes. The object will be this | 271 // Notification sent when the number of tabs changes. The object will be this |
| 269 // controller. | 272 // controller. |
| 270 extern NSString* const kTabStripNumberOfTabsChanged; | 273 extern NSString* const kTabStripNumberOfTabsChanged; |
| 271 | 274 |
| 272 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ | 275 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| OLD | NEW |