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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 maxY:(CGFloat)maxY | 462 maxY:(CGFloat)maxY |
463 width:(CGFloat)width { | 463 width:(CGFloat)width { |
464 NSView* containerView = [infoBarContainerController_ view]; | 464 NSView* containerView = [infoBarContainerController_ view]; |
465 NSRect containerFrame = [containerView frame]; | 465 NSRect containerFrame = [containerView frame]; |
466 maxY -= NSHeight(containerFrame); | 466 maxY -= NSHeight(containerFrame); |
467 maxY += [infoBarContainerController_ overlappingTipHeight]; | 467 maxY += [infoBarContainerController_ overlappingTipHeight]; |
468 containerFrame.origin.x = minX; | 468 containerFrame.origin.x = minX; |
469 containerFrame.origin.y = maxY; | 469 containerFrame.origin.y = maxY; |
470 containerFrame.size.width = width; | 470 containerFrame.size.width = width; |
471 [containerView setFrame:containerFrame]; | 471 [containerView setFrame:containerFrame]; |
| 472 [infoBarContainerController_ setMaxTopArrowHeight:[self |
| 473 getMaxTopInfoBarArrowHeight]]; |
472 return maxY; | 474 return maxY; |
473 } | 475 } |
474 | 476 |
475 - (CGFloat)layoutDownloadShelfAtMinX:(CGFloat)minX | 477 - (CGFloat)layoutDownloadShelfAtMinX:(CGFloat)minX |
476 minY:(CGFloat)minY | 478 minY:(CGFloat)minY |
477 width:(CGFloat)width { | 479 width:(CGFloat)width { |
478 if (downloadShelfController_.get()) { | 480 if (downloadShelfController_.get()) { |
479 NSView* downloadView = [downloadShelfController_ view]; | 481 NSView* downloadView = [downloadShelfController_ view]; |
480 NSRect downloadFrame = [downloadView frame]; | 482 NSRect downloadFrame = [downloadView frame]; |
481 downloadFrame.origin.x = minX; | 483 downloadFrame.origin.x = minX; |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 if (devTools) | 1060 if (devTools) |
1059 devTools->SetAllowOverlappingViews(allowOverlappingViews); | 1061 devTools->SetAllowOverlappingViews(allowOverlappingViews); |
1060 } | 1062 } |
1061 | 1063 |
1062 - (void)updateInfoBarTipVisibility { | 1064 - (void)updateInfoBarTipVisibility { |
1063 // If there's no toolbar then hide the infobar tip. | 1065 // If there's no toolbar then hide the infobar tip. |
1064 [infoBarContainerController_ | 1066 [infoBarContainerController_ |
1065 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; | 1067 setShouldSuppressTopInfoBarTip:![self hasToolbar]]; |
1066 } | 1068 } |
1067 | 1069 |
| 1070 - (NSInteger)getMaxTopInfoBarArrowHeight { |
| 1071 NSInteger topArrowHeight = 0; |
| 1072 LocationBarViewMac* locationBarView = [self locationBarBridge]; |
| 1073 NSPoint iconBottom = locationBarView->GetPageInfoBubblePoint(); |
| 1074 |
| 1075 CGFloat overlappingTipHeight = |
| 1076 [infoBarContainerController_ overlappingTipHeight]; |
| 1077 NSPoint infoBarTop = |
| 1078 NSMakePoint(0, NSHeight([infoBarContainerController_ view].frame) - |
| 1079 overlappingTipHeight); |
| 1080 infoBarTop = [[infoBarContainerController_ view] convertPoint:infoBarTop |
| 1081 toView:nil]; |
| 1082 |
| 1083 topArrowHeight = iconBottom.y - infoBarTop.y; |
| 1084 return topArrowHeight; |
| 1085 } |
| 1086 |
1068 @end // @implementation BrowserWindowController(Private) | 1087 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |