| Index: ios/web/shell/shell_network_delegate.cc
|
| diff --git a/content/shell/browser/shell_network_delegate.cc b/ios/web/shell/shell_network_delegate.cc
|
| similarity index 65%
|
| copy from content/shell/browser/shell_network_delegate.cc
|
| copy to ios/web/shell/shell_network_delegate.cc
|
| index 135bba36d0e302d0a7fc6aaeb3ff57246304acb9..a973f4c7e9131ee82c50e76f86cf51b355c38b84 100644
|
| --- a/content/shell/browser/shell_network_delegate.cc
|
| +++ b/ios/web/shell/shell_network_delegate.cc
|
| @@ -1,20 +1,12 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/shell/browser/shell_network_delegate.h"
|
| +#include "ios/web/shell/shell_network_delegate.h"
|
|
|
| -#include "base/command_line.h"
|
| -#include "content/public/common/content_switches.h"
|
| #include "net/base/net_errors.h"
|
| -#include "net/base/static_cookie_policy.h"
|
| -#include "net/url_request/url_request.h"
|
|
|
| -namespace content {
|
| -
|
| -namespace {
|
| -bool g_accept_all_cookies = true;
|
| -}
|
| +namespace web {
|
|
|
| ShellNetworkDelegate::ShellNetworkDelegate() {
|
| }
|
| @@ -22,10 +14,6 @@ ShellNetworkDelegate::ShellNetworkDelegate() {
|
| ShellNetworkDelegate::~ShellNetworkDelegate() {
|
| }
|
|
|
| -void ShellNetworkDelegate::SetAcceptAllCookies(bool accept) {
|
| - g_accept_all_cookies = accept;
|
| -}
|
| -
|
| int ShellNetworkDelegate::OnBeforeURLRequest(
|
| net::URLRequest* request,
|
| const net::CompletionCallback& callback,
|
| @@ -85,25 +73,13 @@ ShellNetworkDelegate::AuthRequiredResponse ShellNetworkDelegate::OnAuthRequired(
|
|
|
| bool ShellNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
|
| const net::CookieList& cookie_list) {
|
| - net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
|
| - net::StaticCookiePolicy::ALLOW_ALL_COOKIES :
|
| - net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
|
| - net::StaticCookiePolicy policy(policy_type);
|
| - int rv = policy.CanGetCookies(
|
| - request.url(), request.first_party_for_cookies());
|
| - return rv == net::OK;
|
| + return true;
|
| }
|
|
|
| bool ShellNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
|
| const std::string& cookie_line,
|
| net::CookieOptions* options) {
|
| - net::StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
|
| - net::StaticCookiePolicy::ALLOW_ALL_COOKIES :
|
| - net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
|
| - net::StaticCookiePolicy policy(policy_type);
|
| - int rv = policy.CanSetCookie(
|
| - request.url(), request.first_party_for_cookies());
|
| - return rv == net::OK;
|
| + return true;
|
| }
|
|
|
| bool ShellNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
|
| @@ -116,9 +92,4 @@ bool ShellNetworkDelegate::OnCanThrottleRequest(
|
| return false;
|
| }
|
|
|
| -bool ShellNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const {
|
| - return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kEnableExperimentalWebPlatformFeatures);
|
| -}
|
| -
|
| -} // namespace content
|
| +} // namespace web
|
|
|