OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/character_encoding.h" | 10 #include "chrome/browser/character_encoding.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 WideToASCII(prefs->GetString(prefs::kDefaultCharset)); | 183 WideToASCII(prefs->GetString(prefs::kDefaultCharset)); |
184 | 184 |
185 web_prefs.javascript_can_open_windows_automatically = | 185 web_prefs.javascript_can_open_windows_automatically = |
186 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); | 186 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); |
187 web_prefs.dom_paste_enabled = | 187 web_prefs.dom_paste_enabled = |
188 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); | 188 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); |
189 web_prefs.shrinks_standalone_images_to_fit = | 189 web_prefs.shrinks_standalone_images_to_fit = |
190 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); | 190 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); |
191 web_prefs.inspector_settings = WideToUTF8( | 191 web_prefs.inspector_settings = WideToUTF8( |
192 prefs->GetString(prefs::kWebKitInspectorSettings)); | 192 prefs->GetString(prefs::kWebKitInspectorSettings)); |
| 193 web_prefs.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks); |
193 | 194 |
194 { // Command line switches are used for preferences with no user interface. | 195 { // Command line switches are used for preferences with no user interface. |
195 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 196 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
196 web_prefs.developer_extras_enabled = | 197 web_prefs.developer_extras_enabled = |
197 !command_line.HasSwitch(switches::kDisableDevTools); | 198 !command_line.HasSwitch(switches::kDisableDevTools); |
198 web_prefs.javascript_enabled = | 199 web_prefs.javascript_enabled = |
199 !command_line.HasSwitch(switches::kDisableJavaScript) && | 200 !command_line.HasSwitch(switches::kDisableJavaScript) && |
200 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); | 201 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); |
201 web_prefs.web_security_enabled = | 202 web_prefs.web_security_enabled = |
202 !command_line.HasSwitch(switches::kDisableWebSecurity) && | 203 !command_line.HasSwitch(switches::kDisableWebSecurity) && |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 257 } |
257 DCHECK(!web_prefs.default_encoding.empty()); | 258 DCHECK(!web_prefs.default_encoding.empty()); |
258 | 259 |
259 if (is_dom_ui) { | 260 if (is_dom_ui) { |
260 web_prefs.loads_images_automatically = true; | 261 web_prefs.loads_images_automatically = true; |
261 web_prefs.javascript_enabled = true; | 262 web_prefs.javascript_enabled = true; |
262 } | 263 } |
263 | 264 |
264 return web_prefs; | 265 return web_prefs; |
265 } | 266 } |
OLD | NEW |