diff options
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 11 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_window_controller.h | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_window_controller.mm | 23 |
3 files changed, 11 insertions, 28 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 32dd545..43ffa11 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -1148,17 +1148,6 @@ willPositionSheet:(NSWindow*)sheet return defaultSheetRect; } -// In addition to the tab strip and content area, which the superview's impl -// takes care of, we need to add the toolbar and bookmark bar to the -// overlay so they draw correctly when dragging out a new window. -- (NSArray*)viewsToMoveToOverlay { - NSArray* views = [super viewsToMoveToOverlay]; - NSArray* browserViews = - [NSArray arrayWithObjects:[toolbarController_ view], - nil]; - return [views arrayByAddingObjectsFromArray:browserViews]; -} - // Undocumented method for multi-touch gestures in 10.5. Future OS's will // likely add a public API, but the worst that will happen is that this will // turn into dead code and just won't get called. diff --git a/chrome/browser/cocoa/tab_window_controller.h b/chrome/browser/cocoa/tab_window_controller.h index 17c1a543..ed3c23b 100644 --- a/chrome/browser/cocoa/tab_window_controller.h +++ b/chrome/browser/cocoa/tab_window_controller.h @@ -123,11 +123,6 @@ @end @interface TabWindowController(ProtectedMethods) -// A list of all the views that need to move to the overlay window. Subclasses -// can override this to add more things besides the tab strip. Be sure to -// call the superclass' version if overridden. -- (NSArray*)viewsToMoveToOverlay; - // Tells the tab strip to forget about this tab in preparation for it being // put into a different tab strip, such as during a drop on another window. - (void)detachTabView:(NSView*)view; diff --git a/chrome/browser/cocoa/tab_window_controller.mm b/chrome/browser/cocoa/tab_window_controller.mm index e405887..7ca47ea 100644 --- a/chrome/browser/cocoa/tab_window_controller.mm +++ b/chrome/browser/cocoa/tab_window_controller.mm @@ -60,20 +60,21 @@ [self setUseOverlay:YES]; } -- (NSArray*)viewsToMoveToOverlay { - return [NSArray arrayWithObjects:[self tabStripView], - [self tabContentArea], nil]; -} - // if |useOverlay| is true, we're moving views into the overlay's content // area. If false, we're moving out of the overlay back into the window's // content. - (void)moveViewsBetweenWindowAndOverlay:(BOOL)useOverlay { - NSView* moveTo = useOverlay ? - [overlayWindow_ contentView] : [cachedContentView_ superview]; - NSArray* viewsToMove = [self viewsToMoveToOverlay]; - for (NSView* view in viewsToMove) - [moveTo addSubview:view]; + if (useOverlay) { + [[[overlayWindow_ contentView] superview] addSubview:[self tabStripView]]; + // Add the original window's content view as a subview of the overlay + // window's content view. We cannot simply use setContentView: here because + // the overlay window has a different content size (due to it being + // borderless). + [[overlayWindow_ contentView] addSubview:cachedContentView_]; + } else { + [[[[self window] contentView] superview] addSubview:[self tabStripView]]; + [[self window] setContentView:cachedContentView_]; + } } // If |useOverlay| is YES, creates a new overlay window and puts the tab strip @@ -95,8 +96,6 @@ [overlayWindow_ setBackgroundColor:[NSColor clearColor]]; [overlayWindow_ setOpaque:NO]; [overlayWindow_ setDelegate:self]; - NSView *contentView = [overlayWindow_ contentView]; - [contentView addSubview:[self tabStripView]]; cachedContentView_ = [[self window] contentView]; [self moveViewsBetweenWindowAndOverlay:useOverlay]; [[self window] addChildWindow:overlayWindow_ ordered:NSWindowAbove]; |