Chromium Code Reviews| 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..522f355d94ab0d4c268cfcd8ad191d21dc54c731 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,10 +49,12 @@ void LocationBarBubbleDelegateView::WebContentMouseHandler::OnTouchEvent( |
| LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
| views::View* anchor_view, |
| + const gfx::Point& anchor_point, |
| + views::BubbleBorder::Arrow arrow, |
| content::WebContents* web_contents) |
| - : BubbleDialogDelegateView(anchor_view, |
| - anchor_view ? views::BubbleBorder::TOP_RIGHT |
| - : views::BubbleBorder::NONE) { |
| + : BubbleDialogDelegateView( |
| + anchor_view, |
| + anchor_view ? views::BubbleBorder::TOP_RIGHT : arrow) { |
| // Add observer to close the bubble if the fullscreen state changes. |
| if (web_contents) { |
| Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| @@ -61,6 +63,11 @@ LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
| content::Source<FullscreenController>( |
| browser->exclusive_access_manager()->fullscreen_controller())); |
| } |
| + if (!anchor_view) { |
| + SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); |
| + return; |
| + } |
| + |
| // 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. |
| @@ -68,6 +75,16 @@ LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
| GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
| } |
| +LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( |
| + views::View* anchor_view, |
| + content::WebContents* web_contents) |
| + : BubbleDialogDelegateView(anchor_view, |
| + anchor_view ? views::BubbleBorder::TOP_RIGHT |
| + : views::BubbleBorder::NONE) { |
| + LocationBarBubbleDelegateView(anchor_view, gfx::Point(), |
|
tapted
2017/04/11 07:48:58
this looks odd - is this just creating a temporary
varkha
2017/04/12 01:57:28
Yes, not really sure what I thought I was doing he
|
| + views::BubbleBorder::NONE, web_contents); |
| +} |
| + |
| LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {} |
| void LocationBarBubbleDelegateView::ShowForReason(DisplayReason reason) { |