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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 1881093002: Implement Tab Detaching in Fullscreen Mode on Mac OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add to the histogram Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 64adb652fc7812a436cdc08055a387bb71ab9a8c..87aa090af6ebf5f0e0ab370d8601708f1af926c7 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -124,6 +124,28 @@ void RecordFullscreenStyle(FullscreenStyle style) {
delegate:self]);
}
+- (void)updateFullscreenCollectionBehavior {
+ // Set the window to participate in Lion Fullscreen mode. Setting this flag
+ // has no effect on Snow Leopard or earlier. Panels can share a fullscreen
+ // space with a tabbed window, but they can not be primary fullscreen
+ // windows.
+ // This ensures the fullscreen button is appropriately positioned. It must
+ // be done before calling layoutSubviews because the new avatar button's
+ // position depends on the fullscreen button's position, as well as
+ // TabStripController's rightIndentForControls.
+ // The fullscreen button's position may depend on the old avatar button's
+ // width, but that does not require calling layoutSubviews first.
+ NSWindow* window = [self window];
+ NSUInteger collectionBehavior = [window collectionBehavior];
+ collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary;
+ collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
+ collectionBehavior |= browser_->type() == Browser::TYPE_TABBED ||
+ browser_->type() == Browser::TYPE_POPUP
+ ? NSWindowCollectionBehaviorFullScreenPrimary
+ : NSWindowCollectionBehaviorFullScreenAuxiliary;
+ [window setCollectionBehavior:collectionBehavior];
+}
+
- (void)saveWindowPositionIfNeeded {
if (!chrome::ShouldSaveWindowPlacement(browser_.get()))
return;
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698