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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1512843002: Lock '--disable-web-security' to '--user-data-dir' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset); 2254 web_prefs->default_encoding = prefs->GetString(prefs::kDefaultCharset);
2255 2255
2256 web_prefs->javascript_can_open_windows_automatically = 2256 web_prefs->javascript_can_open_windows_automatically =
2257 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically); 2257 prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically);
2258 web_prefs->dom_paste_enabled = 2258 web_prefs->dom_paste_enabled =
2259 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled); 2259 prefs->GetBoolean(prefs::kWebKitDomPasteEnabled);
2260 web_prefs->tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks); 2260 web_prefs->tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks);
2261 2261
2262 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled)) 2262 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled))
2263 web_prefs->javascript_enabled = false; 2263 web_prefs->javascript_enabled = false;
2264 if (!prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled)) 2264
2265 // Only allow disabling web security via the command-line flag if the user
2266 // has specified a distinct profile directory. This still enables tests to
2267 // disable web security by setting the pref directly.
2268 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
2269 if (!prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled)) {
2265 web_prefs->web_security_enabled = false; 2270 web_prefs->web_security_enabled = false;
2271 } else if (!web_prefs->web_security_enabled &&
2272 command_line->HasSwitch(switches::kDisableWebSecurity) &&
2273 !command_line->HasSwitch(switches::kUserDataDir)) {
2274 VLOG(1) << "Web security may only be disabled if '--user-data-dir' is "
Mike West 2015/12/09 12:37:55 Maybe `LOG(ERROR)`?
2275 "also specified.";
2276 web_prefs->web_security_enabled = true;
2277 }
2278
2266 if (!prefs->GetBoolean(prefs::kWebKitPluginsEnabled)) 2279 if (!prefs->GetBoolean(prefs::kWebKitPluginsEnabled))
2267 web_prefs->plugins_enabled = false; 2280 web_prefs->plugins_enabled = false;
2268 web_prefs->loads_images_automatically = 2281 web_prefs->loads_images_automatically =
2269 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); 2282 prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically);
2270 2283
2271 if (prefs->GetBoolean(prefs::kDisable3DAPIs)) 2284 if (prefs->GetBoolean(prefs::kDisable3DAPIs))
2272 web_prefs->experimental_webgl_enabled = false; 2285 web_prefs->experimental_webgl_enabled = false;
2273 2286
2274 web_prefs->allow_displaying_insecure_content = 2287 web_prefs->allow_displaying_insecure_content =
2275 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent); 2288 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent);
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2783 if (channel <= kMaxDisableEncryptionChannel) { 2796 if (channel <= kMaxDisableEncryptionChannel) {
2784 static const char* const kWebRtcDevSwitchNames[] = { 2797 static const char* const kWebRtcDevSwitchNames[] = {
2785 switches::kDisableWebRtcEncryption, 2798 switches::kDisableWebRtcEncryption,
2786 }; 2799 };
2787 to_command_line->CopySwitchesFrom(from_command_line, 2800 to_command_line->CopySwitchesFrom(from_command_line,
2788 kWebRtcDevSwitchNames, 2801 kWebRtcDevSwitchNames,
2789 arraysize(kWebRtcDevSwitchNames)); 2802 arraysize(kWebRtcDevSwitchNames));
2790 } 2803 }
2791 } 2804 }
2792 #endif // defined(ENABLE_WEBRTC) 2805 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698