| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 web_prefs.default_font_size = | 129 web_prefs.default_font_size = |
| 130 prefs->GetInteger(prefs::kWebKitDefaultFontSize); | 130 prefs->GetInteger(prefs::kWebKitDefaultFontSize); |
| 131 web_prefs.default_fixed_font_size = | 131 web_prefs.default_fixed_font_size = |
| 132 prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); | 132 prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize); |
| 133 web_prefs.minimum_font_size = | 133 web_prefs.minimum_font_size = |
| 134 prefs->GetInteger(prefs::kWebKitMinimumFontSize); | 134 prefs->GetInteger(prefs::kWebKitMinimumFontSize); |
| 135 web_prefs.minimum_logical_font_size = | 135 web_prefs.minimum_logical_font_size = |
| 136 prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize); | 136 prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize); |
| 137 | 137 |
| 138 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); | 138 web_prefs.default_encoding = |
| 139 WideToASCII(prefs->GetString(prefs::kDefaultCharset)); |
| 139 | 140 |
| 140 web_prefs.javascript_can_open_windows_automatically = | 141 web_prefs.javascript_can_open_windows_automatically = |
| 141 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); | 142 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); |
| 142 web_prefs.dom_paste_enabled = | 143 web_prefs.dom_paste_enabled = |
| 143 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); | 144 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); |
| 144 web_prefs.shrinks_standalone_images_to_fit = | 145 web_prefs.shrinks_standalone_images_to_fit = |
| 145 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); | 146 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); |
| 146 web_prefs.inspector_settings = | 147 web_prefs.inspector_settings = |
| 147 prefs->GetString(prefs::kWebKitInspectorSettings); | 148 prefs->GetString(prefs::kWebKitInspectorSettings); |
| 148 | 149 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 196 |
| 196 // User CSS is currently disabled because it crashes chrome. See | 197 // User CSS is currently disabled because it crashes chrome. See |
| 197 // webkit/glue/webpreferences.h for more details. | 198 // webkit/glue/webpreferences.h for more details. |
| 198 | 199 |
| 199 // Make sure we will set the default_encoding with canonical encoding name. | 200 // Make sure we will set the default_encoding with canonical encoding name. |
| 200 web_prefs.default_encoding = | 201 web_prefs.default_encoding = |
| 201 CharacterEncoding::GetCanonicalEncodingNameByAliasName( | 202 CharacterEncoding::GetCanonicalEncodingNameByAliasName( |
| 202 web_prefs.default_encoding); | 203 web_prefs.default_encoding); |
| 203 if (web_prefs.default_encoding.empty()) { | 204 if (web_prefs.default_encoding.empty()) { |
| 204 prefs->ClearPref(prefs::kDefaultCharset); | 205 prefs->ClearPref(prefs::kDefaultCharset); |
| 205 web_prefs.default_encoding = prefs->GetString( | 206 web_prefs.default_encoding = WideToASCII( |
| 206 prefs::kDefaultCharset); | 207 prefs->GetString(prefs::kDefaultCharset)); |
| 207 } | 208 } |
| 208 DCHECK(!web_prefs.default_encoding.empty()); | 209 DCHECK(!web_prefs.default_encoding.empty()); |
| 209 | 210 |
| 210 if (is_dom_ui) { | 211 if (is_dom_ui) { |
| 211 web_prefs.loads_images_automatically = true; | 212 web_prefs.loads_images_automatically = true; |
| 212 web_prefs.javascript_enabled = true; | 213 web_prefs.javascript_enabled = true; |
| 213 } | 214 } |
| 214 | 215 |
| 215 return web_prefs; | 216 return web_prefs; |
| 216 } | 217 } |
| OLD | NEW |