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/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 [sourceWindow setDelegate:nil]; | 575 [sourceWindow setDelegate:nil]; |
576 [destWindow setDelegate:self]; | 576 [destWindow setDelegate:self]; |
577 | 577 |
578 // With this call, valgrind complains that a "Conditional jump or move depends | 578 // With this call, valgrind complains that a "Conditional jump or move depends |
579 // on uninitialised value(s)". The error happens in -[NSThemeFrame | 579 // on uninitialised value(s)". The error happens in -[NSThemeFrame |
580 // drawOverlayRect:]. I'm pretty convinced this is an Apple bug, but there is | 580 // drawOverlayRect:]. I'm pretty convinced this is an Apple bug, but there is |
581 // no visual impact. I have been unable to tickle it away with other window | 581 // no visual impact. I have been unable to tickle it away with other window |
582 // or view manipulation Cocoa calls. Stack added to suppressions_mac.txt. | 582 // or view manipulation Cocoa calls. Stack added to suppressions_mac.txt. |
583 [contentView setAutoresizesSubviews:YES]; | 583 [contentView setAutoresizesSubviews:YES]; |
584 [destWindow setContentView:contentView]; | 584 [destWindow setContentView:contentView]; |
| 585 [self moveContentViewToBack:contentView]; |
585 | 586 |
586 // Move the incognito badge if present. | 587 // Move the incognito badge if present. |
587 if ([self shouldShowAvatar]) { | 588 if ([self shouldShowAvatar]) { |
588 NSView* avatarButtonView = [avatarButtonController_ view]; | 589 NSView* avatarButtonView = [avatarButtonController_ view]; |
589 | 590 |
590 [avatarButtonView removeFromSuperview]; | 591 [avatarButtonView removeFromSuperview]; |
591 [avatarButtonView setHidden:YES]; // Will be shown in layout. | 592 [avatarButtonView setHidden:YES]; // Will be shown in layout. |
592 [[destWindow cr_windowView] addSubview:avatarButtonView]; | 593 [[destWindow cr_windowView] addSubview:avatarButtonView]; |
593 } | 594 } |
594 | 595 |
595 // Add the tab strip after setting the content view and moving the incognito | 596 // Add the tab strip after setting the content view and moving the incognito |
596 // badge (if any), so that the tab strip will be on top (in the z-order). | 597 // badge (if any), so that the tab strip will be on top (in the z-order). |
597 if ([self hasTabStrip]) | 598 if ([self hasTabStrip]) |
598 [[destWindow cr_windowView] addSubview:tabStripView]; | 599 [self insertTabStripView:tabStripView intoWindow:[self window]]; |
599 | 600 |
600 [sourceWindow setWindowController:nil]; | 601 [sourceWindow setWindowController:nil]; |
601 [self setWindow:destWindow]; | 602 [self setWindow:destWindow]; |
602 [destWindow setWindowController:self]; | 603 [destWindow setWindowController:self]; |
603 | 604 |
604 // Move the status bubble over, if we have one. | 605 // Move the status bubble over, if we have one. |
605 if (statusBubble_) | 606 if (statusBubble_) |
606 statusBubble_->SwitchParentWindow(destWindow); | 607 statusBubble_->SwitchParentWindow(destWindow); |
607 | 608 |
608 // Move the title over. | 609 // Move the title over. |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 } | 1053 } |
1053 } | 1054 } |
1054 | 1055 |
1055 - (void)updateInfoBarTipVisibility { | 1056 - (void)updateInfoBarTipVisibility { |
1056 // If there's no toolbar then hide the infobar tip. | 1057 // If there's no toolbar then hide the infobar tip. |
1057 [infoBarContainerController_ | 1058 [infoBarContainerController_ |
1058 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; | 1059 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; |
1059 } | 1060 } |
1060 | 1061 |
1061 @end // @implementation BrowserWindowController(Private) | 1062 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |