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

Side by Side Diff: chrome/browser/renderer_preferences_util.cc

Issue 2138613002: Set the font family for the "system-ui" generic font family on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "components/prefs/pref_service.h" 15 #include "components/prefs/pref_service.h"
16 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
17 #include "content/public/common/renderer_preferences.h" 17 #include "content/public/common/renderer_preferences.h"
18 #include "content/public/common/webrtc_ip_handling_policy.h" 18 #include "content/public/common/webrtc_ip_handling_policy.h"
19 #include "third_party/skia/include/core/SkColor.h" 19 #include "third_party/skia/include/core/SkColor.h"
20 20
21 #if defined(OS_LINUX)
22 #include "ui/base/resource/resource_bundle.h"
23 #endif
24
21 #if defined(OS_LINUX) || defined(OS_ANDROID) 25 #if defined(OS_LINUX) || defined(OS_ANDROID)
22 #include "ui/gfx/font_render_params.h" 26 #include "ui/gfx/font_render_params.h"
23 #endif 27 #endif
24 28
25 #if defined(TOOLKIT_VIEWS) 29 #if defined(TOOLKIT_VIEWS)
26 #include "ui/views/controls/textfield/textfield.h" 30 #include "ui/views/controls/textfield/textfield.h"
27 #endif 31 #endif
28 32
29 #if defined(OS_MACOSX) 33 #if defined(OS_MACOSX)
30 #include "ui/base/cocoa/defaults_utils.h" 34 #include "ui/base/cocoa/defaults_utils.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, 162 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params,
159 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL))); 163 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL)));
160 prefs->should_antialias_text = params.antialiasing; 164 prefs->should_antialias_text = params.antialiasing;
161 prefs->use_subpixel_positioning = params.subpixel_positioning; 165 prefs->use_subpixel_positioning = params.subpixel_positioning;
162 prefs->hinting = params.hinting; 166 prefs->hinting = params.hinting;
163 prefs->use_autohinter = params.autohinter; 167 prefs->use_autohinter = params.autohinter;
164 prefs->use_bitmaps = params.use_bitmaps; 168 prefs->use_bitmaps = params.use_bitmaps;
165 prefs->subpixel_rendering = params.subpixel_rendering; 169 prefs->subpixel_rendering = params.subpixel_rendering;
166 #endif 170 #endif
167 171
172 #if defined(OS_LINUX)
173 prefs->system_font_family_name = ui::ResourceBundle::GetSharedInstance()
174 .GetFontWithDelta(0).GetFontName();
175 #endif
176
168 #if !defined(OS_MACOSX) 177 #if !defined(OS_MACOSX)
169 prefs->plugin_fullscreen_allowed = 178 prefs->plugin_fullscreen_allowed =
170 pref_service->GetBoolean(prefs::kFullscreenAllowed); 179 pref_service->GetBoolean(prefs::kFullscreenAllowed);
171 #endif 180 #endif
172 } 181 }
173 182
174 } // namespace renderer_preferences_util 183 } // namespace renderer_preferences_util
OLDNEW
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698