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 e1dc5368eb5704d8744af69085e792c2d3cc4ca0..e4282bdc6e61910732a97e50208df8bcaba3166d 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
@@ -51,6 +51,7 @@ |
#include "ui/base/keycodes/keyboard_codes.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/l10n/l10n_util_win.h" |
+#include "ui/base/scale.h" |
#include "ui/base/win/mouse_wheel_util.h" |
#include "ui/gfx/canvas.h" |
#include "ui/views/button_drag_utils.h" |
@@ -504,8 +505,20 @@ OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller, |
tm.tmInternalLeading) * kXHeightRatio) + 0.5); |
// The distance from the top of the field to the desired baseline of the |
// rendered text. |
- const int kTextBaseline = popup_window_mode_ ? 15 : 18; |
- font_y_adjustment_ = kTextBaseline - font_.GetBaseline(); |
+ int text_baseline = popup_window_mode_ ? 15 : 18; |
+ switch (ui::GetDisplayScale()) { |
+ case ui::SCALE_METRO_100: |
+ case ui::SCALE_METRO_140: |
+ case ui::SCALE_METRO_180: |
+ // TODO(joi): Metro scales other than 100% will probably need a |
+ // different value. |
+ text_baseline = 21; |
Peter Kasting
2012/04/19 17:39:55
If I understand correctly, this is because in metr
|
+ break; |
+ default: |
+ // Leave the default as calculated above. |
+ break; |
+ } |
+ font_y_adjustment_ = text_baseline - font_.GetBaseline(); |
// Get the number of twips per pixel, which we need below to offset our text |
// by the desired number of pixels. |