Chromium Code Reviews| 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 web_prefs.plugins_enabled = | 159 web_prefs.plugins_enabled = |
| 159 !command_line.HasSwitch(switches::kDisablePlugins) && | 160 !command_line.HasSwitch(switches::kDisablePlugins) && |
| 160 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 161 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
| 162 #else | |
| 163 web_prefs.plugins_enabled = | |
| 164 command_line.HasSwitch(switches::kEnablePlugins) && | |
| 165 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | |
|
Evan Martin
2009/07/13 21:39:07
what is this pref?
| |
| 166 #endif | |
| 161 web_prefs.java_enabled = | 167 web_prefs.java_enabled = |
| 162 !command_line.HasSwitch(switches::kDisableJava) && | 168 !command_line.HasSwitch(switches::kDisableJava) && |
| 163 prefs->GetBoolean(prefs::kWebKitJavaEnabled); | 169 prefs->GetBoolean(prefs::kWebKitJavaEnabled); |
| 164 web_prefs.loads_images_automatically = | 170 web_prefs.loads_images_automatically = |
| 165 !command_line.HasSwitch(switches::kDisableImages) && | 171 !command_line.HasSwitch(switches::kDisableImages) && |
| 166 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); | 172 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); |
| 167 web_prefs.uses_page_cache = | 173 web_prefs.uses_page_cache = |
| 168 command_line.HasSwitch(switches::kEnableFastback); | 174 command_line.HasSwitch(switches::kEnableFastback); |
| 169 web_prefs.remote_fonts_enabled = | 175 web_prefs.remote_fonts_enabled = |
| 170 command_line.HasSwitch(switches::kEnableRemoteFonts); | 176 command_line.HasSwitch(switches::kEnableRemoteFonts); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 191 } | 197 } |
| 192 DCHECK(!web_prefs.default_encoding.empty()); | 198 DCHECK(!web_prefs.default_encoding.empty()); |
| 193 | 199 |
| 194 if (is_dom_ui) { | 200 if (is_dom_ui) { |
| 195 web_prefs.loads_images_automatically = true; | 201 web_prefs.loads_images_automatically = true; |
| 196 web_prefs.javascript_enabled = true; | 202 web_prefs.javascript_enabled = true; |
| 197 } | 203 } |
| 198 | 204 |
| 199 return web_prefs; | 205 return web_prefs; |
| 200 } | 206 } |
| OLD | NEW |