| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/sdk_forward_declarations.h" | 8 #import "base/mac/sdk_forward_declarations.h" |
| 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
| 10 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 10 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 [[self tabStripView] setInATabDraggingOverlayWindow:YES]; | 175 [[self tabStripView] setInATabDraggingOverlayWindow:YES]; |
| 176 [[overlayWindow_ contentView] addSubview:originalContentView_]; | 176 [[overlayWindow_ contentView] addSubview:originalContentView_]; |
| 177 | 177 |
| 178 [overlayWindow_ orderFront:nil]; | 178 [overlayWindow_ orderFront:nil]; |
| 179 } else if (!useOverlay && overlayWindow_) { | 179 } else if (!useOverlay && overlayWindow_) { |
| 180 DCHECK(originalContentView_); | 180 DCHECK(originalContentView_); |
| 181 | 181 |
| 182 // Return the original window's tab strip view and content view to their | 182 // Return the original window's tab strip view and content view to their |
| 183 // places. The TabStripView always needs to be in front of the window's | 183 // places. The TabStripView always needs to be in front of the window's |
| 184 // content view and therefore it should always be added after the content | 184 // content view and therefore it should always be added after the content |
| 185 // view is set. | 185 // view is set. It needs to be positioned at the bottom of the view |
| 186 // hierarchy to ensure that it does not overlap the avatar button icon. |
| 186 [[window contentView] addSubview:originalContentView_ | 187 [[window contentView] addSubview:originalContentView_ |
| 187 positioned:NSWindowBelow | 188 positioned:NSWindowBelow |
| 188 relativeTo:nil]; | 189 relativeTo:nil]; |
| 189 originalContentView_.frame = [[window contentView] bounds]; | 190 originalContentView_.frame = [[window contentView] bounds]; |
| 190 [[window contentView] addSubview:[self tabStripView]]; | 191 [[window contentView] addSubview:[self tabStripView] |
| 192 positioned:NSWindowBelow |
| 193 relativeTo:nil]; |
| 191 [[self tabStripView] setInATabDraggingOverlayWindow:NO]; | 194 [[self tabStripView] setInATabDraggingOverlayWindow:NO]; |
| 192 [[window contentView] updateTrackingAreas]; | 195 [[window contentView] updateTrackingAreas]; |
| 193 | 196 |
| 194 [focusBeforeOverlay_ restoreFocusInWindow:window]; | 197 [focusBeforeOverlay_ restoreFocusInWindow:window]; |
| 195 focusBeforeOverlay_.reset(); | 198 focusBeforeOverlay_.reset(); |
| 196 | 199 |
| 197 [window display]; | 200 [window display]; |
| 198 [window removeChildWindow:overlayWindow_]; | 201 [window removeChildWindow:overlayWindow_]; |
| 199 | 202 |
| 200 [overlayWindow_ orderOut:nil]; | 203 [overlayWindow_ orderOut:nil]; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 [visualEffectView addSubview:tabStripBackgroundView_]; | 393 [visualEffectView addSubview:tabStripBackgroundView_]; |
| 391 } | 394 } |
| 392 | 395 |
| 393 // Called when the size of the window content area has changed. Override to | 396 // Called when the size of the window content area has changed. Override to |
| 394 // position specific views. Base class implementation does nothing. | 397 // position specific views. Base class implementation does nothing. |
| 395 - (void)layoutSubviews { | 398 - (void)layoutSubviews { |
| 396 NOTIMPLEMENTED(); | 399 NOTIMPLEMENTED(); |
| 397 } | 400 } |
| 398 | 401 |
| 399 @end | 402 @end |
| OLD | NEW |