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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm

Issue 2862003004: Mac: Fix infobar anchor under Harmony. (Closed)
Patch Set: s/. I/ i/ Created 3 years, 7 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/location_bar/autocomplete_text_field.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
index 13549db2d0242b415c67da0f0cbc5664808d55e3..00a78454ae71680e2c627b47c053a1f58a145486 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
@@ -288,23 +288,25 @@ const CGFloat kAnimationDuration = 0.2;
}
- (NSPoint)bubblePointForDecoration:(LocationBarDecoration*)decoration {
- NSPoint point;
- if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
- // Under MD, dialogs have no arrow and anchor to corner of the decoration
- // frame, not a specific point within it. See http://crbug.com/566115.
- BOOL isLeftDecoration;
- const NSRect frame =
- [[self cell] backgroundFrameForDecoration:decoration
- inFrame:[self bounds]
- isLeftDecoration:&isLeftDecoration];
- point.y = NSMaxY(frame);
- point.x = isLeftDecoration ? NSMinX(frame) : NSMaxX(frame);
- } else {
- const NSRect frame =
- [[self cell] frameForDecoration:decoration inFrame:[self bounds]];
- point = decoration->GetBubblePointInFrame(frame);
- }
+ if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
+ return [self arrowAnchorPointForDecoration:decoration];
+
+ // Under MD, dialogs have no arrow and anchor to corner of the decoration
+ // frame, not a specific point within it. See http://crbug.com/566115.
+ BOOL isLeftDecoration;
+ const NSRect frame =
+ [[self cell] backgroundFrameForDecoration:decoration
+ inFrame:[self bounds]
+ isLeftDecoration:&isLeftDecoration];
+ NSPoint point = NSMakePoint(isLeftDecoration ? NSMinX(frame) : NSMaxX(frame),
+ NSMaxY(frame));
+ return [self convertPoint:point toView:nil];
+}
+- (NSPoint)arrowAnchorPointForDecoration:(LocationBarDecoration*)decoration {
+ const NSRect frame =
+ [[self cell] frameForDecoration:decoration inFrame:[self bounds]];
+ NSPoint point = decoration->GetBubblePointInFrame(frame);
return [self convertPoint:point toView:nil];
}

Powered by Google App Engine
This is Rietveld 408576698