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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 59193005: Fixes build breakage of non-Aura Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 299bfc99e173c0ec8b196b4fe7ebfbd87e9a8b41..febdf1e31d04f1cbff393873d489915bf32f9a64 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -449,8 +449,7 @@ OmniboxViewWin::OmniboxViewWin(OmniboxEditController* controller,
LocationBarView* location_bar,
CommandUpdater* command_updater,
bool popup_window_mode,
- const gfx::FontList& font_list,
- int font_y_offset)
+ const gfx::FontList& font_list)
: OmniboxView(location_bar->profile(), controller, command_updater),
popup_view_(OmniboxPopupContentsView::Create(
font_list, this, model(), location_bar)),
@@ -464,7 +463,7 @@ OmniboxViewWin::OmniboxViewWin(OmniboxEditController* controller,
ignore_ime_messages_(false),
delete_at_end_pressed_(false),
font_list_(font_list),
- font_y_adjustment_(font_y_offset),
+ font_y_adjustment_(0),
possible_drag_(false),
in_drag_(false),
initiated_drag_(false),
@@ -522,6 +521,10 @@ OmniboxViewWin::OmniboxViewWin(OmniboxEditController* controller,
const float kXHeightRatio = 0.7f;
font_x_height_ = static_cast<int>(
(static_cast<float>(cap_height) * kXHeightRatio) + 0.5);
+ // Determine the y offset centering cap height.
+ const int location_height = location_bar_->GetInternalHeight(true);
+ font_y_adjustment_ = std::max(0,
Peter Kasting 2013/11/05 19:22:39 Nit: All lines of args to a function call should b
Yuki 2013/11/06 05:35:10 Done.
+ int((location_height - cap_height) / 2 - tm.tmInternalLeading));
Peter Kasting 2013/11/05 19:22:39 Why is the int cast needed here? I don't think th
Yuki 2013/11/06 05:35:10 Done. A template function std::max(T, T) requires
// Get the number of twips per pixel, which we need below to offset our text
// by the desired number of pixels.
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698