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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm

Issue 520733004: mac, yosemite: Resize button causes fullscreen effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against top of tree. Created 6 years, 3 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
index c6dfa624f0ef37063166cb708b2cc7b1306d5482..6cca97080f79e08ab8343926edac80fc25e8f215 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
@@ -51,6 +51,7 @@
base::scoped_nsobject<FramedBrowserWindow> window(
[[FramedBrowserWindow alloc] initWithContentRect:contentRect
hasTabStrip:hasTabStrip]);
+ [self moveContentViewToBack:[window contentView]];
[window setReleasedWhenClosed:YES];
[window setAutorecalculatesKeyViewLoop:YES];
@@ -68,7 +69,7 @@
[tabStripView_ setAutoresizingMask:NSViewWidthSizable |
NSViewMinYMargin];
if (hasTabStrip)
- [self addTabStripToWindow];
+ [self insertTabStripView:tabStripView_ intoWindow:[self window]];
}
return self;
}
@@ -81,16 +82,6 @@
return tabContentArea_;
}
-// Add the top tab strop to the window, above the content box and add it to the
-// view hierarchy as a sibling of the content view so it can overlap with the
-// window frame.
-- (void)addTabStripToWindow {
- // The frame doesn't matter. This class relies on subclasses to do tab strip
- // layout.
- NSView* contentParent = [[self window] cr_windowView];
- [contentParent addSubview:tabStripView_];
-}
-
- (void)removeOverlay {
[self setUseOverlay:NO];
if (closeDeferred_) {
@@ -154,7 +145,8 @@
// content view and therefore it should always be added after the content
// view is set.
[window setContentView:originalContentView_];
- [[window cr_windowView] addSubview:[self tabStripView]];
+ [self moveContentViewToBack:originalContentView_];
+ [self insertTabStripView:[self tabStripView] intoWindow:window];
[[window cr_windowView] updateTrackingAreas];
[focusBeforeOverlay_ restoreFocusInWindow:window];
@@ -292,6 +284,25 @@
closeDeferred_ = YES;
}
+- (void)moveContentViewToBack:(NSView*)cv {
+ base::scoped_nsobject<NSView> contentView([cv retain]);
+ NSView* superview = [contentView superview];
+ [contentView removeFromSuperview];
+ [superview addSubview:contentView positioned:NSWindowBelow relativeTo:nil];
+}
+
+- (void)insertTabStripView:(NSView*)tabStripView intoWindow:(NSWindow*)window {
+ NSView* contentParent = [window cr_windowView];
+ if (contentParent == [[window contentView] superview]) {
+ // Add the tab strip directly above the content view, if they are siblings.
+ [contentParent addSubview:tabStripView
+ positioned:NSWindowAbove
+ relativeTo:[window contentView]];
+ } else {
+ [contentParent addSubview:tabStripView];
+ }
+}
+
// Called when the size of the window content area has changed. Override to
// position specific views. Base class implementation does nothing.
- (void)layoutSubviews {
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698