OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/renderer_preferences_util.h" | 5 #include "chrome/browser/renderer_preferences_util.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 28 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
29 #include "chrome/browser/themes/theme_service.h" | 29 #include "chrome/browser/themes/theme_service.h" |
30 #include "chrome/browser/themes/theme_service_factory.h" | 30 #include "chrome/browser/themes/theme_service_factory.h" |
31 #include "ui/views/linux_ui/linux_ui.h" | 31 #include "ui/views/linux_ui/linux_ui.h" |
32 #endif | 32 #endif |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 #include "base/win/win_util.h" | 35 #include "base/win/win_util.h" |
36 #include "ui/gfx/platform_font_win.h" | 36 #include "ui/gfx/platform_font_win.h" |
37 #include "ui/gfx/win/dpi.h" | |
37 #endif | 38 #endif |
38 | 39 |
39 namespace renderer_preferences_util { | 40 namespace renderer_preferences_util { |
40 | 41 |
41 void UpdateFromSystemSettings(content::RendererPreferences* prefs, | 42 void UpdateFromSystemSettings(content::RendererPreferences* prefs, |
42 Profile* profile, | 43 Profile* profile, |
43 content::WebContents* web_contents) { | 44 content::WebContents* web_contents) { |
44 const PrefService* pref_service = profile->GetPrefs(); | 45 const PrefService* pref_service = profile->GetPrefs(); |
45 prefs->accept_languages = pref_service->GetString(prefs::kAcceptLanguages); | 46 prefs->accept_languages = pref_service->GetString(prefs::kAcceptLanguages); |
46 prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers); | 47 prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 prefs->menu_font_height = gfx::PlatformFontWin::GetFontSize( | 139 prefs->menu_font_height = gfx::PlatformFontWin::GetFontSize( |
139 metrics.lfMenuFont); | 140 metrics.lfMenuFont); |
140 | 141 |
141 prefs->status_font_family_name = metrics.lfStatusFont.lfFaceName; | 142 prefs->status_font_family_name = metrics.lfStatusFont.lfFaceName; |
142 prefs->status_font_height = gfx::PlatformFontWin::GetFontSize( | 143 prefs->status_font_height = gfx::PlatformFontWin::GetFontSize( |
143 metrics.lfStatusFont); | 144 metrics.lfStatusFont); |
144 | 145 |
145 prefs->message_font_family_name = metrics.lfMessageFont.lfFaceName; | 146 prefs->message_font_family_name = metrics.lfMessageFont.lfFaceName; |
146 prefs->message_font_height = gfx::PlatformFontWin::GetFontSize( | 147 prefs->message_font_height = gfx::PlatformFontWin::GetFontSize( |
147 metrics.lfMessageFont); | 148 metrics.lfMessageFont); |
149 | |
150 prefs->vertical_scroll_bar_width_in_dips = | |
151 gfx::win::GetSystemMetricsInDIP(SM_CXVSCROLL); | |
152 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
| |
153 gfx::win::GetSystemMetricsInDIP(SM_CYHSCROLL); | |
154 prefs->arrow_bitmap_height_vertical_scroll_bar_in_dips = | |
155 gfx::win::GetSystemMetricsInDIP(SM_CYVSCROLL); | |
156 prefs->arrow_bitmap_width_horizontal_scroll_bar_in_dips = | |
157 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
| |
148 #endif | 158 #endif |
149 } | 159 } |
150 | 160 |
151 } // namespace renderer_preferences_util | 161 } // namespace renderer_preferences_util |
OLD | NEW |