OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/web_contents.h" | 5 #include "chrome/browser/tab_contents/web_contents.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); | 1211 web_prefs.default_encoding = prefs->GetString(prefs::kDefaultCharset); |
1212 | 1212 |
1213 web_prefs.javascript_can_open_windows_automatically = | 1213 web_prefs.javascript_can_open_windows_automatically = |
1214 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); | 1214 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); |
1215 web_prefs.dom_paste_enabled = | 1215 web_prefs.dom_paste_enabled = |
1216 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); | 1216 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); |
1217 web_prefs.shrinks_standalone_images_to_fit = | 1217 web_prefs.shrinks_standalone_images_to_fit = |
1218 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); | 1218 prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit); |
1219 | 1219 |
1220 { // Command line switches are used for preferences with no user interface. | 1220 { // Command line switches are used for preferences with no user interface. |
1221 CommandLine command_line; | 1221 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1222 web_prefs.developer_extras_enabled = | 1222 web_prefs.developer_extras_enabled = |
1223 !command_line.HasSwitch(switches::kDisableDevTools) && | 1223 !command_line.HasSwitch(switches::kDisableDevTools) && |
1224 prefs->GetBoolean(prefs::kWebKitDeveloperExtrasEnabled); | 1224 prefs->GetBoolean(prefs::kWebKitDeveloperExtrasEnabled); |
1225 web_prefs.javascript_enabled = | 1225 web_prefs.javascript_enabled = |
1226 !command_line.HasSwitch(switches::kDisableJavaScript) && | 1226 !command_line.HasSwitch(switches::kDisableJavaScript) && |
1227 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); | 1227 prefs->GetBoolean(prefs::kWebKitJavascriptEnabled); |
1228 web_prefs.plugins_enabled = | 1228 web_prefs.plugins_enabled = |
1229 !command_line.HasSwitch(switches::kDisablePlugins) && | 1229 !command_line.HasSwitch(switches::kDisablePlugins) && |
1230 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); | 1230 prefs->GetBoolean(prefs::kWebKitPluginsEnabled); |
1231 web_prefs.java_enabled = | 1231 web_prefs.java_enabled = |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 // The favicon url isn't valid. This means there really isn't a favicon, | 1787 // The favicon url isn't valid. This means there really isn't a favicon, |
1788 // or the favicon url wasn't obtained before the load started. This assumes | 1788 // or the favicon url wasn't obtained before the load started. This assumes |
1789 // the later. | 1789 // the later. |
1790 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1790 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
1791 // its url. | 1791 // its url. |
1792 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1792 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
1793 } | 1793 } |
1794 new_url->set_safe_for_autoreplace(true); | 1794 new_url->set_safe_for_autoreplace(true); |
1795 url_model->Add(new_url); | 1795 url_model->Add(new_url); |
1796 } | 1796 } |
OLD | NEW |