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

Unified Diff: chrome/browser/renderer_preferences_util.cc

Issue 1054243002: Avoid calling the GetSystemMetrics API in the renderer process on Windows to get the scrollbar metr… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/renderer_preferences_util.cc
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
index ce174ef34c6375bea36ef73df2423d1df201c96f..bc96ae931c9e4d3e4001235193db9bbc390d4fd2 100644
--- a/chrome/browser/renderer_preferences_util.cc
+++ b/chrome/browser/renderer_preferences_util.cc
@@ -34,6 +34,7 @@
#if defined(OS_WIN)
#include "base/win/win_util.h"
#include "ui/gfx/platform_font_win.h"
+#include "ui/gfx/win/dpi.h"
#endif
namespace renderer_preferences_util {
@@ -145,6 +146,15 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
prefs->message_font_family_name = metrics.lfMessageFont.lfFaceName;
prefs->message_font_height = gfx::PlatformFontWin::GetFontSize(
metrics.lfMessageFont);
+
+ prefs->vertical_scroll_bar_width_in_dips =
+ gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL);
+ prefs->horizontal_scroll_bar_height_in_dips =
brucedawson 2015/04/03 17:00:24 When are SM_CYHSCROLL, SM_CYVSCROLL, and SM_CXHSCR
ananta 2015/04/03 19:17:03 They are not used as of now. I added those just in
+ gfx::win::GetSystemMetricsInDIP(SM_CYHSCROLL);
+ prefs->arrow_bitmap_height_vertical_scroll_bar_in_dips =
+ gfx::win::GetSystemMetricsInDIP(SM_CYVSCROLL);
+ prefs->arrow_bitmap_width_horizontal_scroll_bar_in_dips =
+ gfx::win::GetSystemMetricsInDIP(SM_CXHSCROLL);
jam 2015/04/03 15:08:19 seems this should be done in content layer instead
ananta 2015/04/03 19:17:03 Moved this as well as the font metrics code above
#endif
}
« no previous file with comments | « no previous file | content/child/webthemeengine_impl_default.h » ('j') | content/child/webthemeengine_impl_default.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698