OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "render_view_host_delegate_helper.h" | 5 #include "render_view_host_delegate_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/character_encoding.h" | 9 #include "chrome/browser/character_encoding.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 !command_line.HasSwitch(switches::kDisablePlugins) && | 158 !command_line.HasSwitch(switches::kDisablePlugins) && |
159 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 159 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
160 web_prefs.java_enabled = | 160 web_prefs.java_enabled = |
161 !command_line.HasSwitch(switches::kDisableJava) && | 161 !command_line.HasSwitch(switches::kDisableJava) && |
162 prefs->GetBoolean(prefs::kWebKitJavaEnabled); | 162 prefs->GetBoolean(prefs::kWebKitJavaEnabled); |
163 web_prefs.loads_images_automatically = | 163 web_prefs.loads_images_automatically = |
164 !command_line.HasSwitch(switches::kDisableImages) && | 164 !command_line.HasSwitch(switches::kDisableImages) && |
165 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); | 165 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); |
166 web_prefs.uses_page_cache = | 166 web_prefs.uses_page_cache = |
167 command_line.HasSwitch(switches::kEnableFastback); | 167 command_line.HasSwitch(switches::kEnableFastback); |
| 168 web_prefs.remote_fonts_enabled = |
| 169 command_line.HasSwitch(switches::kEnableRemoteFonts); |
168 } | 170 } |
169 | 171 |
170 web_prefs.uses_universal_detector = | 172 web_prefs.uses_universal_detector = |
171 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); | 173 prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector); |
172 web_prefs.text_areas_are_resizable = | 174 web_prefs.text_areas_are_resizable = |
173 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); | 175 prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable); |
174 | 176 |
175 // User CSS is currently disabled because it crashes chrome. See | 177 // User CSS is currently disabled because it crashes chrome. See |
176 // webkit/glue/webpreferences.h for more details. | 178 // webkit/glue/webpreferences.h for more details. |
177 | 179 |
178 // Make sure we will set the default_encoding with canonical encoding name. | 180 // Make sure we will set the default_encoding with canonical encoding name. |
179 web_prefs.default_encoding = | 181 web_prefs.default_encoding = |
180 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 182 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
181 web_prefs.default_encoding); | 183 web_prefs.default_encoding); |
182 if (web_prefs.default_encoding.empty()) { | 184 if (web_prefs.default_encoding.empty()) { |
183 prefs->ClearPref(prefs::kDefaultCharset); | 185 prefs->ClearPref(prefs::kDefaultCharset); |
184 web_prefs.default_encoding = prefs->GetString( | 186 web_prefs.default_encoding = prefs->GetString( |
185 prefs::kDefaultCharset); | 187 prefs::kDefaultCharset); |
186 } | 188 } |
187 DCHECK(!web_prefs.default_encoding.empty()); | 189 DCHECK(!web_prefs.default_encoding.empty()); |
188 | 190 |
189 if (is_dom_ui) { | 191 if (is_dom_ui) { |
190 web_prefs.loads_images_automatically = true; | 192 web_prefs.loads_images_automatically = true; |
191 web_prefs.javascript_enabled = true; | 193 web_prefs.javascript_enabled = true; |
192 } | 194 } |
193 | 195 |
194 return web_prefs; | 196 return web_prefs; |
195 } | 197 } |
OLD | NEW |