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

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

Issue 2717603003: [Mac] Make bubble arrow location/position RTL-aware (Closed)
Patch Set: Now with proper enum formatting Created 3 years, 10 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/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 ffaae11522d5c581107e08c4c31b15899c525a6d..2768e534fb516fcc0c77bd7014e1e09bb32ea333 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -114,7 +114,7 @@
self));
}
- [bubble_ setArrowLocation:info_bubble::kTopRight];
+ [bubble_ setArrowLocation:info_bubble::kTopTrailing];
}
- (void)dealloc {
@@ -411,11 +411,13 @@
info_bubble::kBubbleArrowWidth / 2.0, 0);
offsets = [[parentWindow_ contentView] convertSize:offsets toView:nil];
switch ([bubble_ arrowLocation]) {
- case info_bubble::kTopRight:
- origin.x -= NSWidth([window frame]) - offsets.width;
+ case info_bubble::kTopTrailing:
+ origin.x -=
+ isRTL ? offsets.width : NSWidth([window frame]) - offsets.width;
break;
- case info_bubble::kTopLeft:
- origin.x -= offsets.width;
+ case info_bubble::kTopLeading:
+ origin.x -=
+ isRTL ? NSWidth([window frame]) - offsets.width : offsets.width;
break;
case info_bubble::kNoArrow:
// FALLTHROUGH.
@@ -431,7 +433,7 @@
// edge aligns with the anchor. If the arrow is to the left then there's
// nothing to do because the left edge is already aligned with the left
// edge of the anchor.
- if ([bubble_ arrowLocation] == info_bubble::kTopRight) {
+ if ([bubble_ arrowLocation] == info_bubble::kTopTrailing) {
origin.x -= NSWidth([window frame]);
}
break;

Powered by Google App Engine
This is Rietveld 408576698