| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_network_delegate.h" | 5 #include "content/shell/browser/shell_network_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 net::CookieOptions* options) { | 102 net::CookieOptions* options) { |
| 103 net::StaticCookiePolicy::Type policy_type = g_block_third_party_cookies ? | 103 net::StaticCookiePolicy::Type policy_type = g_block_third_party_cookies ? |
| 104 net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES : | 104 net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES : |
| 105 net::StaticCookiePolicy::ALLOW_ALL_COOKIES; | 105 net::StaticCookiePolicy::ALLOW_ALL_COOKIES; |
| 106 net::StaticCookiePolicy policy(policy_type); | 106 net::StaticCookiePolicy policy(policy_type); |
| 107 int rv = | 107 int rv = |
| 108 policy.CanAccessCookies(request.url(), request.first_party_for_cookies()); | 108 policy.CanAccessCookies(request.url(), request.first_party_for_cookies()); |
| 109 return rv == net::OK; | 109 return rv == net::OK; |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool ShellNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, | 112 bool ShellNetworkDelegate::OnCanAccessFile( |
| 113 const base::FilePath& path) const { | 113 const net::URLRequest& request, |
| 114 const base::FilePath& original_path, |
| 115 const base::FilePath& absolute_path) const { |
| 114 return true; | 116 return true; |
| 115 } | 117 } |
| 116 | 118 |
| 117 bool ShellNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { | 119 bool ShellNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { |
| 118 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 120 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 119 switches::kEnableExperimentalWebPlatformFeatures); | 121 switches::kEnableExperimentalWebPlatformFeatures); |
| 120 } | 122 } |
| 121 | 123 |
| 122 bool ShellNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 124 bool ShellNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 123 const net::URLRequest& request, | 125 const net::URLRequest& request, |
| 124 const GURL& target_url, | 126 const GURL& target_url, |
| 125 const GURL& referrer_url) const { | 127 const GURL& referrer_url) const { |
| 126 return g_cancel_requests_with_referrer_policy_violation; | 128 return g_cancel_requests_with_referrer_policy_violation; |
| 127 } | 129 } |
| 128 | 130 |
| 129 } // namespace content | 131 } // namespace content |
| OLD | NEW |