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

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: Fix MacViews bubbles 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
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 {

Powered by Google App Engine
This is Rietveld 408576698