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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 { // Command line switches are used for preferences with no user interface. | 148 { // Command line switches are used for preferences with no user interface. |
149 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 149 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
150 web_prefs.developer_extras_enabled = | 150 web_prefs.developer_extras_enabled = |
151 !command_line.HasSwitch(switches::kDisableDevTools); | 151 !command_line.HasSwitch(switches::kDisableDevTools); |
152 web_prefs.javascript_enabled = | 152 web_prefs.javascript_enabled = |
153 !command_line.HasSwitch(switches::kDisableJavaScript) && | 153 !command_line.HasSwitch(switches::kDisableJavaScript) && |
154 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); | 154 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); |
155 web_prefs.web_security_enabled = | 155 web_prefs.web_security_enabled = |
156 !command_line.HasSwitch(switches::kDisableWebSecurity) && | 156 !command_line.HasSwitch(switches::kDisableWebSecurity) && |
157 prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled); | 157 prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled); |
158 #if defined(OS_WIN) | 158 #if defined(OS_WIN) or defined(OS_MACOSX) |
159 web_prefs.plugins_enabled = | 159 web_prefs.plugins_enabled = |
160 !command_line.HasSwitch(switches::kDisablePlugins) && | 160 !command_line.HasSwitch(switches::kDisablePlugins) && |
161 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 161 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
162 #else | 162 #else |
163 web_prefs.plugins_enabled = | 163 web_prefs.plugins_enabled = |
164 command_line.HasSwitch(switches::kEnablePlugins) && | 164 command_line.HasSwitch(switches::kEnablePlugins) && |
165 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 165 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
166 #endif | 166 #endif |
167 web_prefs.java_enabled = | 167 web_prefs.java_enabled = |
168 !command_line.HasSwitch(switches::kDisableJava) && | 168 !command_line.HasSwitch(switches::kDisableJava) && |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 DCHECK(!web_prefs.default_encoding.empty()); | 202 DCHECK(!web_prefs.default_encoding.empty()); |
203 | 203 |
204 if (is_dom_ui) { | 204 if (is_dom_ui) { |
205 web_prefs.loads_images_automatically = true; | 205 web_prefs.loads_images_automatically = true; |
206 web_prefs.javascript_enabled = true; | 206 web_prefs.javascript_enabled = true; |
207 } | 207 } |
208 | 208 |
209 return web_prefs; | 209 return web_prefs; |
210 } | 210 } |
OLD | NEW |