Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar_view.cc |
| diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc |
| index af414bde030672a3438e2160e4a51fbf3855d741..20f9cb06a0bc37bcb9d419d89cb1b497c4e90bff 100644 |
| --- a/chrome/browser/ui/views/toolbar_view.cc |
| +++ b/chrome/browser/ui/views/toolbar_view.cc |
| @@ -380,6 +380,37 @@ InstantController* ToolbarView::GetInstant() { |
| browser_->instant_controller()->instant() : NULL; |
| } |
| +void ToolbarView::GetOmniboxPopupPositioningInfo( |
|
Peter Kasting
2013/06/06 18:52:16
It seems like LocationBarView could implement this
Peter Kasting
2013/06/06 21:01:11
You didn't do this.
|
| + gfx::Point* top_left_screen_coord, |
| + int* popup_width, |
| + int* left_margin, |
| + int* right_margin) { |
| + gfx::Rect location_bar_bounds(location_bar_->GetContentsBounds()); |
| + const views::Border* border = location_bar_->border(); |
| + if (border) { |
|
Peter Kasting
2013/06/06 18:52:16
When is this true?
brettw
2013/06/06 20:46:49
I have no idea. This code is just moved from Omnib
Peter Kasting
2013/06/06 21:01:11
I tracked this down. This was added for the app l
|
| + // Adjust for the border so that the bubble and location bar borders are |
| + // aligned. |
| + gfx::Insets insets = border->GetInsets(); |
| + location_bar_bounds.Inset(insets.left(), 0, insets.right(), 0); |
| + } else { |
| + // The normal location bar is drawn using a background graphic that includes |
| + // the border, so we inset by enough to make the edges line up, and the |
| + // bubble appear at the same height as the Star bubble. |
| + location_bar_bounds.Inset(LocationBarView::kNormalHorizontalEdgeThickness, |
|
Peter Kasting
2013/06/06 18:52:16
Note: You'll need to update this for recent change
|
| + 0); |
| + } |
| + |
| + *top_left_screen_coord = gfx::Point(0, height()); |
| + views::View::ConvertPointToScreen(this, top_left_screen_coord); |
| + *popup_width = width(); |
| + |
| + gfx::Point location_bar_in_toolbar(location_bar_bounds.origin()); |
| + views::View::ConvertPointToTarget(location_bar_, this, |
| + &location_bar_in_toolbar); |
| + *left_margin = location_bar_in_toolbar.x(); |
| + *right_margin = *popup_width - *left_margin - location_bar_bounds.width(); |
| +} |
| + |
| ContentSettingBubbleModelDelegate* |
| ToolbarView::GetContentSettingBubbleModelDelegate() { |
| return browser_->content_setting_bubble_model_delegate(); |