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

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

Issue 2706273004: [Mac] Fix bubble origin for animated Omnibox decorations (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
index 82251472044c9a12b4c33c31f73d2f5d7e64c537..20ff012d4437c8918d9bb2a446e945b9a8e6b040 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -262,7 +262,14 @@ ContentSettingDecoration::CreateAnimatedText() {
}
NSPoint ContentSettingDecoration::GetBubblePointInFrame(NSRect frame) {
-
+ // Compute the frame as if there is no animation pill in the Omnibox. Place
+ // the bubble where the icon would be without animation, so when the animation
+ // ends, the bubble is pointing in the right place.
+ CGFloat final_width = ImageDecoration::GetWidthForSpace(NSWidth(frame));
+ NSSize image_size = NSMakeSize(final_width, NSHeight(frame));
+ if (!cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
+ frame.origin.x += frame.size.width - image_size.width;
+ frame.size = image_size;
const NSRect draw_frame = GetDrawRectInFrame(frame);
return NSMakePoint(NSMidX(draw_frame),
NSMaxY(draw_frame) + kPageBubblePointYOffset);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698