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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 75543008: Fix alignment for bubbles with center-arrows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/base_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm
index 2b20e209bdeb00bc2747cf986e8125c762c65088..2555f8839995c7ad1476c954e485b9de187a32af 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -251,10 +251,19 @@
NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset +
info_bubble::kBubbleArrowWidth / 2.0, 0);
offsets = [[parentWindow_ contentView] convertSize:offsets toView:nil];
- if ([bubble_ arrowLocation] == info_bubble::kTopRight) {
- origin.x -= NSWidth([window frame]) - offsets.width;
- } else {
- origin.x -= offsets.width;
+ switch ([bubble_ arrowLocation]) {
+ case info_bubble::kTopRight:
+ origin.x -= NSWidth([window frame]) - offsets.width;
+ break;
+ case info_bubble::kTopLeft:
+ origin.x -= offsets.width;
+ break;
+ case info_bubble::kTopCenter:
+ origin.x -= NSWidth([window frame]) / 2.0;
+ break;
+ case info_bubble::kNoArrow:
+ NOTREACHED();
+ break;
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698