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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 15745031: Restyle omnibox popup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Go back to 3 max search suggestions for now Created 7 years, 6 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
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();
« chrome/browser/ui/views/toolbar_view.h ('K') | « chrome/browser/ui/views/toolbar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698