[email protected] | 93270d00 | 2011-01-19 22:32:59 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 2 | // 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] | 0a8db0d | 2011-04-13 15:15:40 | [diff] [blame] | 7 | #include "chrome/browser/prefs/pref_service.h" |
[email protected] | 8ecad5e | 2010-12-02 21:18:33 | [diff] [blame] | 8 | #include "chrome/browser/profiles/profile.h" |
[email protected] | 0a8db0d | 2011-04-13 15:15:40 | [diff] [blame] | 9 | #include "chrome/common/pref_names.h" |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 10 | #include "content/public/common/renderer_preferences.h" |
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 11 | |
[email protected] | 9edeb71 | 2011-09-20 21:20:33 | [diff] [blame] | 12 | #if defined(TOOLKIT_USES_GTK) |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 13 | #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
[email protected] | 93270d00 | 2011-01-19 22:32:59 | [diff] [blame] | 14 | #include "chrome/browser/ui/gtk/gtk_util.h" |
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 15 | #endif |
16 | |||||
17 | namespace renderer_preferences_util { | ||||
18 | |||||
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 19 | void UpdateFromSystemSettings( |
20 | content::RendererPreferences* prefs, Profile* profile) { | ||||
[email protected] | 9edeb71 | 2011-09-20 21:20:33 | [diff] [blame] | 21 | #if defined(TOOLKIT_USES_GTK) |
[email protected] | 7ff431e | 2010-01-07 18:18:54 | [diff] [blame] | 22 | gtk_util::UpdateGtkFontSettings(prefs); |
23 | |||||
[email protected] | 9edeb71 | 2011-09-20 21:20:33 | [diff] [blame] | 24 | #if !defined(OS_CHROMEOS) |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 25 | GtkThemeService* theme_service = GtkThemeService::GetFrom(profile); |
[email protected] | 7ff431e | 2010-01-07 18:18:54 | [diff] [blame] | 26 | |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 27 | 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] | 644d77e | 2010-01-27 01:03:10 | [diff] [blame] | 35 | prefs->inactive_selection_bg_color = |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 36 | theme_service->get_inactive_selection_bg_color(); |
[email protected] | 644d77e | 2010-01-27 01:03:10 | [diff] [blame] | 37 | prefs->inactive_selection_fg_color = |
[email protected] | a0ea76c | 2011-03-23 17:36:42 | [diff] [blame] | 38 | theme_service->get_inactive_selection_fg_color(); |
[email protected] | cf5c066 | 2010-12-21 03:26:11 | [diff] [blame] | 39 | #else |
[email protected] | a12f7fb | 2011-01-20 18:21:08 | [diff] [blame] | 40 | prefs->focus_ring_color = SkColorSetRGB(0x50, 0x7A, 0xD5); |
[email protected] | 0dd6f9b5 | 2010-10-14 16:39:13 | [diff] [blame] | 41 | prefs->active_selection_bg_color = SkColorSetRGB(0xDC, 0xE4, 0xFA); |
42 | prefs->active_selection_fg_color = SK_ColorBLACK; | ||||
[email protected] | 60e9d78 | 2011-06-17 00:39:35 | [diff] [blame] | 43 | prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); |
[email protected] | 0dd6f9b5 | 2010-10-14 16:39:13 | [diff] [blame] | 44 | prefs->inactive_selection_fg_color = SK_ColorBLACK; |
[email protected] | 9edeb71 | 2011-09-20 21:20:33 | [diff] [blame] | 45 | #endif // defined(OS_CHROMEOS) |
[email protected] | 0dd6f9b5 | 2010-10-14 16:39:13 | [diff] [blame] | 46 | |
[email protected] | 9edeb71 | 2011-09-20 21:20:33 | [diff] [blame] | 47 | #endif // defined(TOOLKIT_USES_GTK) |
[email protected] | 0a8db0d | 2011-04-13 15:15:40 | [diff] [blame] | 48 | |
49 | prefs->enable_referrers = | ||||
50 | profile->GetPrefs()->GetBoolean(prefs::kEnableReferrers); | ||||
[email protected] | d051d9a | 2011-12-10 02:02:50 | [diff] [blame] | 51 | prefs->default_zoom_level = |
52 | profile->GetPrefs()->GetDouble(prefs::kDefaultZoomLevel); | ||||
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 53 | } |
54 | |||||
55 | } // renderer_preferences_util |