Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/tab_contents/web_contents.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/sessions/session_restore_uitest.cc ('k') | chrome/browser/unload_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore_uitest.cc ('k') | chrome/browser/unload_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698