OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 bool RenderViewHostDelegateHelper::gpu_enabled_ = true; | 192 bool RenderViewHostDelegateHelper::gpu_enabled_ = true; |
193 | 193 |
194 // static | 194 // static |
195 WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( | 195 WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( |
196 Profile* profile, bool is_web_ui) { | 196 Profile* profile, bool is_web_ui) { |
197 PrefService* prefs = profile->GetPrefs(); | 197 PrefService* prefs = profile->GetPrefs(); |
198 WebPreferences web_prefs; | 198 WebPreferences web_prefs; |
199 | 199 |
| 200 web_prefs.standard_font_family = |
| 201 UTF8ToUTF16(prefs->GetString(prefs::kWebKitStandardFontFamily)); |
200 web_prefs.fixed_font_family = | 202 web_prefs.fixed_font_family = |
201 UTF8ToUTF16(prefs->GetString(prefs::kWebKitFixedFontFamily)); | 203 UTF8ToUTF16(prefs->GetString(prefs::kWebKitFixedFontFamily)); |
202 web_prefs.serif_font_family = | 204 web_prefs.serif_font_family = |
203 UTF8ToUTF16(prefs->GetString(prefs::kWebKitSerifFontFamily)); | 205 UTF8ToUTF16(prefs->GetString(prefs::kWebKitSerifFontFamily)); |
204 web_prefs.sans_serif_font_family = | 206 web_prefs.sans_serif_font_family = |
205 UTF8ToUTF16(prefs->GetString(prefs::kWebKitSansSerifFontFamily)); | 207 UTF8ToUTF16(prefs->GetString(prefs::kWebKitSansSerifFontFamily)); |
206 if (prefs->GetBoolean(prefs::kWebKitStandardFontIsSerif)) | |
207 web_prefs.standard_font_family = web_prefs.serif_font_family; | |
208 else | |
209 web_prefs.standard_font_family = web_prefs.sans_serif_font_family; | |
210 web_prefs.cursive_font_family = | 208 web_prefs.cursive_font_family = |
211 UTF8ToUTF16(prefs->GetString(prefs::kWebKitCursiveFontFamily)); | 209 UTF8ToUTF16(prefs->GetString(prefs::kWebKitCursiveFontFamily)); |
212 web_prefs.fantasy_font_family = | 210 web_prefs.fantasy_font_family = |
213 UTF8ToUTF16(prefs->GetString(prefs::kWebKitFantasyFontFamily)); | 211 UTF8ToUTF16(prefs->GetString(prefs::kWebKitFantasyFontFamily)); |
214 | 212 |
215 web_prefs.default_font_size = | 213 web_prefs.default_font_size = |
216 prefs->GetInteger(prefs::kWebKitDefaultFontSize); | 214 prefs->GetInteger(prefs::kWebKitDefaultFontSize); |
217 web_prefs.default_fixed_font_size = | 215 web_prefs.default_fixed_font_size = |
218 prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); | 216 prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); |
219 web_prefs.minimum_font_size = | 217 web_prefs.minimum_font_size = |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 inspector_settings->SetWithoutPathExpansion(key, | 346 inspector_settings->SetWithoutPathExpansion(key, |
349 Value::CreateStringValue(value)); | 347 Value::CreateStringValue(value)); |
350 } | 348 } |
351 | 349 |
352 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { | 350 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { |
353 DictionaryValue* inspector_settings = | 351 DictionaryValue* inspector_settings = |
354 profile->GetPrefs()->GetMutableDictionary( | 352 profile->GetPrefs()->GetMutableDictionary( |
355 prefs::kWebKitInspectorSettings); | 353 prefs::kWebKitInspectorSettings); |
356 inspector_settings->Clear(); | 354 inspector_settings->Clear(); |
357 } | 355 } |
OLD | NEW |