| 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 "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 "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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 web_prefs.default_encoding = | 141 web_prefs.default_encoding = |
| 142 WideToASCII(prefs->GetString(prefs::kDefaultCharset)); | 142 WideToASCII(prefs->GetString(prefs::kDefaultCharset)); |
| 143 | 143 |
| 144 web_prefs.javascript_can_open_windows_automatically = | 144 web_prefs.javascript_can_open_windows_automatically = |
| 145 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); | 145 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); |
| 146 web_prefs.dom_paste_enabled = | 146 web_prefs.dom_paste_enabled = |
| 147 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); | 147 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); |
| 148 web_prefs.shrinks_standalone_images_to_fit = | 148 web_prefs.shrinks_standalone_images_to_fit = |
| 149 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); | 149 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); |
| 150 web_prefs.inspector_settings = | 150 web_prefs.inspector_settings = WideToUTF8( |
| 151 prefs->GetString(prefs::kWebKitInspectorSettings); | 151 prefs->GetString(prefs::kWebKitInspectorSettings)); |
| 152 | 152 |
| 153 { // Command line switches are used for preferences with no user interface. | 153 { // Command line switches are used for preferences with no user interface. |
| 154 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 154 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 155 web_prefs.developer_extras_enabled = | 155 web_prefs.developer_extras_enabled = |
| 156 !command_line.HasSwitch(switches::kDisableDevTools); | 156 !command_line.HasSwitch(switches::kDisableDevTools); |
| 157 web_prefs.javascript_enabled = | 157 web_prefs.javascript_enabled = |
| 158 !command_line.HasSwitch(switches::kDisableJavaScript) && | 158 !command_line.HasSwitch(switches::kDisableJavaScript) && |
| 159 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); | 159 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); |
| 160 web_prefs.web_security_enabled = | 160 web_prefs.web_security_enabled = |
| 161 !command_line.HasSwitch(switches::kDisableWebSecurity) && | 161 !command_line.HasSwitch(switches::kDisableWebSecurity) && |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 DCHECK(!web_prefs.default_encoding.empty()); | 208 DCHECK(!web_prefs.default_encoding.empty()); |
| 209 | 209 |
| 210 if (is_dom_ui) { | 210 if (is_dom_ui) { |
| 211 web_prefs.loads_images_automatically = true; | 211 web_prefs.loads_images_automatically = true; |
| 212 web_prefs.javascript_enabled = true; | 212 web_prefs.javascript_enabled = true; |
| 213 } | 213 } |
| 214 | 214 |
| 215 return web_prefs; | 215 return web_prefs; |
| 216 } | 216 } |
| OLD | NEW |