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

Unified Diff: chrome/browser/cocoa/location_bar/location_bar_view_mac.mm

Issue 4544004: Fix bubble offset issue (bubble x-coordinate pointing to wrong place) on OS X... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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
« no previous file with comments | « chrome/browser/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/location_bar/location_bar_view_mac.mm
===================================================================
--- chrome/browser/cocoa/location_bar/location_bar_view_mac.mm (revision 65381)
+++ chrome/browser/cocoa/location_bar/location_bar_view_mac.mm (working copy)
@@ -58,10 +58,6 @@
namespace {
-// Horizontal space between the right edge of the |location_icon_decoration_|
-// and the first run bubble arrow point.
-const static int kFirstRunBubbleXOffset = 4;
-
// Vertical space between the bottom edge of the location_bar and the first run
// bubble arrow point.
const static int kFirstRunBubbleYOffset = 1;
@@ -128,9 +124,15 @@
if (!field_ || ![field_ window])
return;
- // The bubble needs to be just below the Omnibox and slightly to the right
- // of the left omnibox icon, so shift x and y co-ordinates.
- const NSPoint kOffset = GetFirstRunBubblePoint();
+ // The first run bubble's left edge should line up with the left edge of the
+ // omnibox. This is different from other bubbles, which line up at a point
+ // set by their top arrow. Because the BaseBubbleController adjusts the
+ // window origin left to account for the arrow spacing, the first run bubble
+ // moves the window origin right by this spacing, so that the
+ // BaseBubbleController will move it back to the correct position.
+ const NSPoint kOffset = NSMakePoint(
+ info_bubble::kBubbleArrowXOffset + info_bubble::kBubbleArrowWidth/2.0,
+ kFirstRunBubbleYOffset);
[FirstRunBubbleController showForView:field_ offset:kOffset profile:profile_];
}
@@ -505,16 +507,6 @@
}
}
-NSPoint LocationBarViewMac::GetFirstRunBubblePoint() const {
- AutocompleteTextFieldCell* cell = [field_ cell];
- const NSRect frame =
- [cell frameForDecoration:location_icon_decoration_.get()
- inFrame:[field_ bounds]];
- return NSMakePoint(
- NSMaxX(frame) + kFirstRunBubbleXOffset,
- kFirstRunBubbleYOffset);
-}
-
NSImage* LocationBarViewMac::GetKeywordImage(const std::wstring& keyword) {
const TemplateURL* template_url =
profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword);
« no previous file with comments | « chrome/browser/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698