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

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

Issue 549303004: Allow default font size changing on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove CHECKs Created 6 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
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | content/renderer/render_view_linux.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
OLDNEW
« no previous file with comments | « no previous file | content/common/view_messages.h » ('j') | content/renderer/render_view_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698