Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
index c107fbdb2b36e4ae286cab08b7ca03e084ecddf5..7ac00a2e2441e6e4026ea455e4764aac09c14414 100644 |
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
@@ -179,7 +179,7 @@ void LocationBarView::Init() { |
} |
// If this makes the font too big, try to make it smaller so it will fit. |
- const int height = GetHeight(); |
+ const int height = GetPreferredInternalHeight(); |
while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1)) |
font_ = font_.DeriveFont(-1); |
@@ -520,7 +520,7 @@ void LocationBarView::Layout() { |
// to position our child views in this case, because other things may be |
// positioned relative to them (e.g. the "bookmark added" bubble if the user |
// hits ctrl-d). |
- int location_height = std::max(height() - (kVerticalEdgeThickness * 2), 0); |
+ int location_height = GetInternalHeightImpl(height()); |
// The edge stroke is 1 px thick. In popup mode, the edges are drawn by the |
// omnibox' parent, so there isn't any edge to account for at all. |
@@ -1276,9 +1276,12 @@ void LocationBarView::Observe(int type, |
} |
} |
-int LocationBarView::GetHeight() { |
- return std::max( |
- GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0); |
+int LocationBarView::GetPreferredInternalHeight() { |
Peter Kasting
2012/05/18 22:45:40
Nit: Functions must be defined in the same order t
|
+ return GetInternalHeightImpl(GetPreferredSize().height()); |
+} |
+ |
+int LocationBarView::GetInternalHeightImpl(int total_height) { |
+ return std::max(total_height - (kVerticalEdgeThickness * 2), 0); |
} |
#if defined(OS_WIN) || defined(USE_AURA) |