Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm

Issue 2233293003: Position Mac permission bubbles on the left when in fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..93454b2eb1907dfeb29d0809b08e53275982c18c 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 kFullscreenLeftMargin = 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) + kFullscreenLeftMargin,
+ NSMaxY(contentFrame));
}
return ui::ConvertPointFromWindowToScreen(parentWindow, anchor);
@@ -484,8 +488,7 @@ - (bool)hasVisibleLocationBar {
}
- (info_bubble::BubbleArrowLocation)getExpectedArrowLocation {
- return [self hasVisibleLocationBar] ? info_bubble::kTopLeft
- : info_bubble::kNoArrow;
+ return info_bubble::kTopLeft;
tapted 2016/08/11 23:51:20 does this mean that there will be an arrow in full
benwells 2016/08/12 04:13:43 Yep, that's what it means. This matches the views
}
- (NSWindow*)getExpectedParentWindow {
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698