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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 [sourceWindow setDelegate:nil]; | 577 [sourceWindow setDelegate:nil]; |
578 [destWindow setDelegate:self]; | 578 [destWindow setDelegate:self]; |
579 | 579 |
580 // With this call, valgrind complains that a "Conditional jump or move depends | 580 // With this call, valgrind complains that a "Conditional jump or move depends |
581 // on uninitialised value(s)". The error happens in -[NSThemeFrame | 581 // on uninitialised value(s)". The error happens in -[NSThemeFrame |
582 // drawOverlayRect:]. I'm pretty convinced this is an Apple bug, but there is | 582 // drawOverlayRect:]. I'm pretty convinced this is an Apple bug, but there is |
583 // no visual impact. I have been unable to tickle it away with other window | 583 // no visual impact. I have been unable to tickle it away with other window |
584 // or view manipulation Cocoa calls. Stack added to suppressions_mac.txt. | 584 // or view manipulation Cocoa calls. Stack added to suppressions_mac.txt. |
585 [contentView setAutoresizesSubviews:YES]; | 585 [contentView setAutoresizesSubviews:YES]; |
586 [destWindow setContentView:contentView]; | 586 [destWindow setContentView:contentView]; |
| 587 [self moveContentViewToBack:contentView]; |
587 | 588 |
588 // Move the incognito badge if present. | 589 // Move the incognito badge if present. |
589 if ([self shouldShowAvatar]) { | 590 if ([self shouldShowAvatar]) { |
590 NSView* avatarButtonView = [avatarButtonController_ view]; | 591 NSView* avatarButtonView = [avatarButtonController_ view]; |
591 | 592 |
592 [avatarButtonView removeFromSuperview]; | 593 [avatarButtonView removeFromSuperview]; |
593 [avatarButtonView setHidden:YES]; // Will be shown in layout. | 594 [avatarButtonView setHidden:YES]; // Will be shown in layout. |
594 [[destWindow cr_windowView] addSubview:avatarButtonView]; | 595 [[destWindow cr_windowView] addSubview:avatarButtonView]; |
595 } | 596 } |
596 | 597 |
597 // Add the tab strip after setting the content view and moving the incognito | 598 // Add the tab strip after setting the content view and moving the incognito |
598 // badge (if any), so that the tab strip will be on top (in the z-order). | 599 // badge (if any), so that the tab strip will be on top (in the z-order). |
599 if ([self hasTabStrip]) | 600 if ([self hasTabStrip]) |
600 [[destWindow cr_windowView] addSubview:tabStripView]; | 601 [self insertTabStripView:tabStripView intoWindow:[self window]]; |
601 | 602 |
602 [sourceWindow setWindowController:nil]; | 603 [sourceWindow setWindowController:nil]; |
603 [self setWindow:destWindow]; | 604 [self setWindow:destWindow]; |
604 [destWindow setWindowController:self]; | 605 [destWindow setWindowController:self]; |
605 | 606 |
606 // Move the status bubble over, if we have one. | 607 // Move the status bubble over, if we have one. |
607 if (statusBubble_) | 608 if (statusBubble_) |
608 statusBubble_->SwitchParentWindow(destWindow); | 609 statusBubble_->SwitchParentWindow(destWindow); |
609 | 610 |
610 // Move the title over. | 611 // Move the title over. |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 NSMakePoint(0, NSHeight([infoBarContainerController_ view].frame) - | 1072 NSMakePoint(0, NSHeight([infoBarContainerController_ view].frame) - |
1072 overlappingTipHeight); | 1073 overlappingTipHeight); |
1073 infoBarTop = [[infoBarContainerController_ view] convertPoint:infoBarTop | 1074 infoBarTop = [[infoBarContainerController_ view] convertPoint:infoBarTop |
1074 toView:nil]; | 1075 toView:nil]; |
1075 | 1076 |
1076 topArrowHeight = iconBottom.y - infoBarTop.y; | 1077 topArrowHeight = iconBottom.y - infoBarTop.y; |
1077 return topArrowHeight; | 1078 return topArrowHeight; |
1078 } | 1079 } |
1079 | 1080 |
1080 @end // @implementation BrowserWindowController(Private) | 1081 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |