Chromium Code Reviews| Index: chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm |
| index 3746bf4223434a3d1158981183746b988977583a..5049adec52889f8d2b221ac9a3aca94a49dd6c09 100644 |
| --- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm |
| +++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm |
| @@ -65,6 +65,8 @@ |
| const CGFloat kBubbleMinWidth = 315.0f; |
| const NSSize kPermissionIconSize = {18, 18}; |
| +const NSInteger kFullscreenLeftOffset = 40; |
| + |
| } // namespace |
| // NSPopUpButton with a menu containing two items: allow and block. |
| @@ -256,9 +258,11 @@ + (NSPoint)getAnchorPointForBrowser:(Browser*)browser { |
| [[parentWindow windowController] locationBarBridge]; |
| anchor = location_bar->GetPageInfoBubblePoint(); |
| } else { |
| - // Center the bubble if there's no location bar. |
| + // Position the bubble on the left of the screen if there is no page info |
| + // button to point at. |
| NSRect contentFrame = [[parentWindow contentView] frame]; |
| - anchor = NSMakePoint(NSMidX(contentFrame), NSMaxY(contentFrame)); |
| + anchor = NSMakePoint(NSMinX(contentFrame) + kFullscreenLeftOffset, |
| + NSMaxY(contentFrame)); |
| } |
| return ui::ConvertPointFromWindowToScreen(parentWindow, anchor); |
| @@ -286,6 +290,10 @@ + (bool)hasVisibleLocationBarForBrowser:(Browser*)browser { |
| return false; |
| } |
| ++ (NSInteger)getFullscreenLeftOffset { |
|
tapted
2016/08/12 04:25:39
nit: move to after onClose
benwells
2016/08/12 06:29:44
Done.
|
| + return kFullscreenLeftOffset; |
| +} |
| + |
| - (void)windowWillClose:(NSNotification*)notification { |
| [[NSNotificationCenter defaultCenter] |
| removeObserver:self |
| @@ -484,8 +492,7 @@ - (bool)hasVisibleLocationBar { |
| } |
| - (info_bubble::BubbleArrowLocation)getExpectedArrowLocation { |
| - return [self hasVisibleLocationBar] ? info_bubble::kTopLeft |
| - : info_bubble::kNoArrow; |
| + return info_bubble::kTopLeft; |
| } |
| - (NSWindow*)getExpectedParentWindow { |