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 "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
10 #include "content/public/common/renderer_preferences.h" | 10 #include "content/public/common/renderer_preferences.h" |
11 | 11 |
12 #if defined(TOOLKIT_GTK) | 12 #if defined(TOOLKIT_GTK) |
13 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 13 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
14 #include "chrome/browser/ui/gtk/gtk_util.h" | 14 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 15 #elif defined(USE_ASH) |
| 16 #include "base/command_line.h" |
| 17 #include "ui/base/ui_base_switches.h" |
15 #endif | 18 #endif |
16 | 19 |
17 namespace renderer_preferences_util { | 20 namespace renderer_preferences_util { |
18 | 21 |
19 void UpdateFromSystemSettings( | 22 void UpdateFromSystemSettings( |
20 content::RendererPreferences* prefs, Profile* profile) { | 23 content::RendererPreferences* prefs, Profile* profile) { |
21 #if defined(TOOLKIT_GTK) | 24 #if defined(TOOLKIT_GTK) |
22 gtk_util::UpdateGtkFontSettings(prefs); | 25 gtk_util::UpdateGtkFontSettings(prefs); |
23 | 26 |
24 GtkThemeService* theme_service = GtkThemeService::GetFrom(profile); | 27 GtkThemeService* theme_service = GtkThemeService::GetFrom(profile); |
25 | 28 |
26 prefs->focus_ring_color = theme_service->get_focus_ring_color(); | 29 prefs->focus_ring_color = theme_service->get_focus_ring_color(); |
27 prefs->thumb_active_color = theme_service->get_thumb_active_color(); | 30 prefs->thumb_active_color = theme_service->get_thumb_active_color(); |
28 prefs->thumb_inactive_color = theme_service->get_thumb_inactive_color(); | 31 prefs->thumb_inactive_color = theme_service->get_thumb_inactive_color(); |
29 prefs->track_color = theme_service->get_track_color(); | 32 prefs->track_color = theme_service->get_track_color(); |
30 prefs->active_selection_bg_color = | 33 prefs->active_selection_bg_color = |
31 theme_service->get_active_selection_bg_color(); | 34 theme_service->get_active_selection_bg_color(); |
32 prefs->active_selection_fg_color = | 35 prefs->active_selection_fg_color = |
33 theme_service->get_active_selection_fg_color(); | 36 theme_service->get_active_selection_fg_color(); |
34 prefs->inactive_selection_bg_color = | 37 prefs->inactive_selection_bg_color = |
35 theme_service->get_inactive_selection_bg_color(); | 38 theme_service->get_inactive_selection_bg_color(); |
36 prefs->inactive_selection_fg_color = | 39 prefs->inactive_selection_fg_color = |
37 theme_service->get_inactive_selection_fg_color(); | 40 theme_service->get_inactive_selection_fg_color(); |
38 #elif defined(USE_ASH) | 41 #elif defined(USE_ASH) |
| 42 // TODO(derat): This code and GetCairoFontOptions() from ui/gfx/pango_util.cc |
| 43 // should get their settings from the same place. |
| 44 prefs->use_subpixel_positioning = |
| 45 CommandLine::ForCurrentProcess()->HasSwitch( |
| 46 switches::kEnableTextSubpixelPositioning); |
| 47 |
39 // This color is 0x544d90fe modulated with 0xffffff. | 48 // This color is 0x544d90fe modulated with 0xffffff. |
40 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); | 49 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); |
41 prefs->active_selection_fg_color = SK_ColorBLACK; | 50 prefs->active_selection_fg_color = SK_ColorBLACK; |
42 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); | 51 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); |
43 prefs->inactive_selection_fg_color = SK_ColorBLACK; | 52 prefs->inactive_selection_fg_color = SK_ColorBLACK; |
44 #endif | 53 #endif |
45 | 54 |
46 prefs->enable_referrers = | 55 prefs->enable_referrers = |
47 profile->GetPrefs()->GetBoolean(prefs::kEnableReferrers); | 56 profile->GetPrefs()->GetBoolean(prefs::kEnableReferrers); |
48 prefs->default_zoom_level = | 57 prefs->default_zoom_level = |
49 profile->GetPrefs()->GetDouble(prefs::kDefaultZoomLevel); | 58 profile->GetPrefs()->GetDouble(prefs::kDefaultZoomLevel); |
50 } | 59 } |
51 | 60 |
52 } // renderer_preferences_util | 61 } // renderer_preferences_util |
OLD | NEW |