blob: fe6359b6ea13c46180ba0a0a5eefa2c35f7b15dc [file] [log] [blame]
[email protected]93270d002011-01-19 22:32:591// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]93623c5d2009-12-10 21:40:322// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/renderer_preferences_util.h"
6
[email protected]0a8db0d2011-04-13 15:15:407#include "chrome/browser/prefs/pref_service.h"
[email protected]8ecad5e2010-12-02 21:18:338#include "chrome/browser/profiles/profile.h"
[email protected]0a8db0d2011-04-13 15:15:409#include "chrome/common/pref_names.h"
[email protected]daf82f82011-10-31 22:35:3110#include "content/public/common/renderer_preferences.h"
[email protected]93623c5d2009-12-10 21:40:3211
[email protected]9edeb712011-09-20 21:20:3312#if defined(TOOLKIT_USES_GTK)
[email protected]a0ea76c2011-03-23 17:36:4213#include "chrome/browser/ui/gtk/gtk_theme_service.h"
[email protected]93270d002011-01-19 22:32:5914#include "chrome/browser/ui/gtk/gtk_util.h"
[email protected]93623c5d2009-12-10 21:40:3215#endif
16
17namespace renderer_preferences_util {
18
[email protected]daf82f82011-10-31 22:35:3119void UpdateFromSystemSettings(
20 content::RendererPreferences* prefs, Profile* profile) {
[email protected]9edeb712011-09-20 21:20:3321#if defined(TOOLKIT_USES_GTK)
[email protected]7ff431e2010-01-07 18:18:5422 gtk_util::UpdateGtkFontSettings(prefs);
23
[email protected]9edeb712011-09-20 21:20:3324#if !defined(OS_CHROMEOS)
[email protected]a0ea76c2011-03-23 17:36:4225 GtkThemeService* theme_service = GtkThemeService::GetFrom(profile);
[email protected]7ff431e2010-01-07 18:18:5426
[email protected]a0ea76c2011-03-23 17:36:4227 prefs->focus_ring_color = theme_service->get_focus_ring_color();
28 prefs->thumb_active_color = theme_service->get_thumb_active_color();
29 prefs->thumb_inactive_color = theme_service->get_thumb_inactive_color();
30 prefs->track_color = theme_service->get_track_color();
31 prefs->active_selection_bg_color =
32 theme_service->get_active_selection_bg_color();
33 prefs->active_selection_fg_color =
34 theme_service->get_active_selection_fg_color();
[email protected]644d77e2010-01-27 01:03:1035 prefs->inactive_selection_bg_color =
[email protected]a0ea76c2011-03-23 17:36:4236 theme_service->get_inactive_selection_bg_color();
[email protected]644d77e2010-01-27 01:03:1037 prefs->inactive_selection_fg_color =
[email protected]a0ea76c2011-03-23 17:36:4238 theme_service->get_inactive_selection_fg_color();
[email protected]cf5c0662010-12-21 03:26:1139#else
[email protected]a12f7fb2011-01-20 18:21:0840 prefs->focus_ring_color = SkColorSetRGB(0x50, 0x7A, 0xD5);
[email protected]0dd6f9b52010-10-14 16:39:1341 prefs->active_selection_bg_color = SkColorSetRGB(0xDC, 0xE4, 0xFA);
42 prefs->active_selection_fg_color = SK_ColorBLACK;
[email protected]60e9d782011-06-17 00:39:3543 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA);
[email protected]0dd6f9b52010-10-14 16:39:1344 prefs->inactive_selection_fg_color = SK_ColorBLACK;
[email protected]9edeb712011-09-20 21:20:3345#endif // defined(OS_CHROMEOS)
[email protected]0dd6f9b52010-10-14 16:39:1346
[email protected]9edeb712011-09-20 21:20:3347#endif // defined(TOOLKIT_USES_GTK)
[email protected]0a8db0d2011-04-13 15:15:4048
49 prefs->enable_referrers =
50 profile->GetPrefs()->GetBoolean(prefs::kEnableReferrers);
[email protected]d051d9a2011-12-10 02:02:5051 prefs->default_zoom_level =
52 profile->GetPrefs()->GetDouble(prefs::kDefaultZoomLevel);
[email protected]93623c5d2009-12-10 21:40:3253}
54
55} // renderer_preferences_util