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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 1056003003: Policy: Ignore ForceSafeSearch if ForceGoogleSafeSearch or ForceYoutubeSafetyMode are enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 6368532cf3931a3fa72e69c5b62ce8acfb271634..8e5d0db7a34ab5c0d520c96d84be2651240278ec 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -397,8 +397,13 @@ int ChromeNetworkDelegate::OnBeforeURLRequest(
request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */);
bool force_safe_search =
- (force_safe_search_ && force_safe_search_->GetValue()) ||
(force_google_safe_search_ && force_google_safe_search_->GetValue());
+ if (!force_safe_search &&
Marc Treib 2015/04/14 13:27:15 I guess this part isn't *strictly* required for th
+ !(force_youtube_safety_mode_ && force_youtube_safety_mode_->GetValue())) {
+ // In case neither ForceGoogleSafeSearch nor ForceYoutubeSafetyMode are
+ // enabled, fall back to the deprecated ForceSafeSearch. crbug.com/476908
+ force_safe_search = (force_safe_search_ && force_safe_search_->GetValue());
+ }
net::CompletionCallback wrapped_callback = callback;
if (force_safe_search) {
@@ -425,8 +430,13 @@ int ChromeNetworkDelegate::OnBeforeSendHeaders(
const net::CompletionCallback& callback,
net::HttpRequestHeaders* headers) {
bool force_safety_mode =
- (force_safe_search_ && force_safe_search_->GetValue()) ||
(force_youtube_safety_mode_ && force_youtube_safety_mode_->GetValue());
+ if (!force_safety_mode &&
+ !(force_google_safe_search_ && force_google_safe_search_->GetValue())) {
+ // In case neither ForceGoogleSafeSearch nor ForceYoutubeSafetyMode are
+ // enabled, fall back to the deprecated ForceSafeSearch. crbug.com/476908
+ force_safety_mode = (force_safe_search_ && force_safe_search_->GetValue());
+ }
if (force_safety_mode)
safe_search_util::ForceYouTubeSafetyMode(request, headers);
« no previous file with comments | « no previous file | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698