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

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

Issue 9985012: Adjust location of text in omnibox edit control for Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. 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 9a8d6fbfe8435ec6654feeb046fcc35748558421..c24b5149303e8740457b69056e35b9c120f4bc2e 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -178,8 +178,7 @@ void LocationBarView::Init() {
}
// If this makes the font too big, try to make it smaller so it will fit.
- const int height =
- std::max(GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0);
+ const int height = GetHeight();
while ((font_.GetHeight() > height) && (font_.GetFontSize() > 1))
font_ = font_.DeriveFont(-1);
@@ -1276,6 +1275,11 @@ void LocationBarView::Observe(int type,
}
}
+int LocationBarView::GetHeight() {
+ return std::max(
+ GetPreferredSize().height() - (kVerticalEdgeThickness * 2), 0);
+}
+
#if defined(OS_WIN) || defined(USE_AURA)
bool LocationBarView::HasValidSuggestText() const {
return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() &&
« 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