| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 std::make_pair(*iter, value)); | 393 std::make_pair(*iter, value)); |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 web_prefs.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks); | 396 web_prefs.tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks); |
| 397 | 397 |
| 398 { // Command line switches are used for preferences with no user interface. | 398 { // Command line switches are used for preferences with no user interface. |
| 399 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 399 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 400 web_prefs.developer_extras_enabled = true; | 400 web_prefs.developer_extras_enabled = true; |
| 401 web_prefs.javascript_enabled = | 401 web_prefs.javascript_enabled = |
| 402 !command_line.HasSwitch(switches::kDisableJavaScript) && | 402 !command_line.HasSwitch(switches::kDisableJavaScript) && |
| 403 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); | 403 prefs->GetBoolean(prefs::kWebKitGlobalJavascriptEnabled); |
| 404 web_prefs.web_security_enabled = | 404 web_prefs.web_security_enabled = |
| 405 !command_line.HasSwitch(switches::kDisableWebSecurity) && | 405 !command_line.HasSwitch(switches::kDisableWebSecurity) && |
| 406 prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled); | 406 prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled); |
| 407 web_prefs.plugins_enabled = | 407 web_prefs.plugins_enabled = |
| 408 !command_line.HasSwitch(switches::kDisablePlugins) && | 408 !command_line.HasSwitch(switches::kDisablePlugins) && |
| 409 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 409 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
| 410 web_prefs.java_enabled = | 410 web_prefs.java_enabled = |
| 411 !command_line.HasSwitch(switches::kDisableJava) && | 411 !command_line.HasSwitch(switches::kDisableJava) && |
| 412 prefs->GetBoolean(prefs::kWebKitJavaEnabled); | 412 prefs->GetBoolean(prefs::kWebKitJavaEnabled); |
| 413 web_prefs.loads_images_automatically = | 413 web_prefs.loads_images_automatically = |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 DictionaryValue* inspector_settings = update.Get(); | 581 DictionaryValue* inspector_settings = update.Get(); |
| 582 inspector_settings->SetWithoutPathExpansion(key, | 582 inspector_settings->SetWithoutPathExpansion(key, |
| 583 Value::CreateStringValue(value)); | 583 Value::CreateStringValue(value)); |
| 584 } | 584 } |
| 585 | 585 |
| 586 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 586 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
| 587 content::BrowserContext* browser_context) { | 587 content::BrowserContext* browser_context) { |
| 588 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 588 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
| 589 ClearPref(prefs::kWebKitInspectorSettings); | 589 ClearPref(prefs::kWebKitInspectorSettings); |
| 590 } | 590 } |
| OLD | NEW |