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" |
11 #include "content/public/common/renderer_preferences.h" | 11 #include "content/public/common/renderer_preferences.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
13 | 13 |
14 #if defined(OS_LINUX) || defined(OS_ANDROID) | 14 #if defined(OS_LINUX) || defined(OS_ANDROID) |
15 #include "ui/gfx/font_render_params.h" | 15 #include "ui/gfx/font_render_params.h" |
| 16 #include "ui/gfx/platform_font.h" |
16 #endif | 17 #endif |
17 | 18 |
18 #if defined(TOOLKIT_VIEWS) | 19 #if defined(TOOLKIT_VIEWS) |
19 #include "ui/views/controls/textfield/textfield.h" | 20 #include "ui/views/controls/textfield/textfield.h" |
20 #endif | 21 #endif |
21 | 22 |
22 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 23 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
23 #include "chrome/browser/themes/theme_service.h" | 24 #include "chrome/browser/themes/theme_service.h" |
24 #include "chrome/browser/themes/theme_service_factory.h" | 25 #include "chrome/browser/themes/theme_service_factory.h" |
25 #include "ui/views/linux_ui/linux_ui.h" | 26 #include "ui/views/linux_ui/linux_ui.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 76 |
76 #if defined(OS_LINUX) || defined(OS_ANDROID) | 77 #if defined(OS_LINUX) || defined(OS_ANDROID) |
77 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, | 78 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, |
78 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL))); | 79 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL))); |
79 prefs->should_antialias_text = params.antialiasing; | 80 prefs->should_antialias_text = params.antialiasing; |
80 prefs->use_subpixel_positioning = params.subpixel_positioning; | 81 prefs->use_subpixel_positioning = params.subpixel_positioning; |
81 prefs->hinting = params.hinting; | 82 prefs->hinting = params.hinting; |
82 prefs->use_autohinter = params.autohinter; | 83 prefs->use_autohinter = params.autohinter; |
83 prefs->use_bitmaps = params.use_bitmaps; | 84 prefs->use_bitmaps = params.use_bitmaps; |
84 prefs->subpixel_rendering = params.subpixel_rendering; | 85 prefs->subpixel_rendering = params.subpixel_rendering; |
| 86 |
| 87 scoped_refptr<gfx::PlatformFont> default_font( |
| 88 gfx::PlatformFont::CreateDefault()); |
| 89 prefs->default_font_size = default_font->GetFontSize(); |
85 #endif | 90 #endif |
86 | 91 |
87 #if !defined(OS_MACOSX) | 92 #if !defined(OS_MACOSX) |
88 prefs->plugin_fullscreen_allowed = | 93 prefs->plugin_fullscreen_allowed = |
89 pref_service->GetBoolean(prefs::kFullscreenAllowed); | 94 pref_service->GetBoolean(prefs::kFullscreenAllowed); |
90 #endif | 95 #endif |
91 } | 96 } |
92 | 97 |
93 } // namespace renderer_preferences_util | 98 } // namespace renderer_preferences_util |
OLD | NEW |