Index: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc |
diff --git a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc |
index 27543b4e2af1d075ea2066b1c7d8963483d8bd2a..0d18c6b3ae17f21301eaf67d0f10d0b172e8c2fb 100644 |
--- a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc |
+++ b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc |
@@ -49,6 +49,7 @@ void LocationBarBubbleDelegateView::WebContentMouseHandler::OnTouchEvent( |
LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
views::View* anchor_view, |
+ const gfx::Point& anchor_point, |
content::WebContents* web_contents) |
: BubbleDialogDelegateView(anchor_view, |
anchor_view ? views::BubbleBorder::TOP_RIGHT |
@@ -61,13 +62,22 @@ LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
content::Source<FullscreenController>( |
browser->exclusive_access_manager()->fullscreen_controller())); |
} |
+ if (!anchor_view) |
+ SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); |
+ |
// Compensate for built-in vertical padding in the anchor view's image. |
// In the case of Harmony, this is just compensating for the location bar's |
// border thickness, as the bubble's top border should overlap it. |
+ // When anchor is controlled by the |anchor_point| this inset is ignored. |
set_anchor_view_insets(gfx::Insets( |
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
} |
+LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
+ views::View* anchor_view, |
+ content::WebContents* web_contents) |
+ : LocationBarBubbleDelegateView(anchor_view, gfx::Point(), web_contents) {} |
+ |
LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {} |
void LocationBarBubbleDelegateView::ShowForReason(DisplayReason reason) { |