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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 10399074: Cleanup: Rename GetHeight to more appropriate GetPreferredInternalHeight. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove GetInternalHeightImpl Created 8 years, 7 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/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 2c77d599e3aa5355467a6382f3cccd6d43ad824a..9b508f0fd83bb8a9147d2f98ee47752a89a720d3 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -182,7 +182,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 = GetInternalHeight(true);
while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1))
font_ = font_.DeriveFont(-1);
@@ -526,7 +526,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 = GetInternalHeight(false);
// 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.
@@ -1293,9 +1293,10 @@ void LocationBarView::Observe(int type,
}
}
-int LocationBarView::GetHeight() {
- return std::max(
- GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0);
+int LocationBarView::GetInternalHeight(bool use_preferred_size) {
+ int total_height =
+ use_preferred_size ? GetPreferredSize().height() : height();
+ return std::max(total_height - (kVerticalEdgeThickness * 2), 0);
}
#if defined(OS_WIN) || defined(USE_AURA)
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698