| OLD | NEW |
| 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 "android_webview/browser/aw_cookie_access_policy.h" | 5 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_contents_io_thread_client.h" | 9 #include "android_webview/browser/aw_contents_io_thread_client.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 return StaticCookiePolicy::BLOCK_ALL_COOKIES; | 135 return StaticCookiePolicy::BLOCK_ALL_COOKIES; |
| 136 } | 136 } |
| 137 if (accept_third_party_cookies() || isFile) { | 137 if (accept_third_party_cookies() || isFile) { |
| 138 return StaticCookiePolicy::ALLOW_ALL_COOKIES; | 138 return StaticCookiePolicy::ALLOW_ALL_COOKIES; |
| 139 } | 139 } |
| 140 return StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES; | 140 return StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES; |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool AwStaticCookiePolicy::AllowSet(const GURL& url, | 143 bool AwStaticCookiePolicy::AllowSet(const GURL& url, |
| 144 const GURL& first_party) const { | 144 const GURL& first_party) const { |
| 145 | 145 return StaticCookiePolicy(GetPolicy(url)) |
| 146 return StaticCookiePolicy(GetPolicy(url)).CanSetCookie(url, first_party) == | 146 .CanAccessCookies(url, first_party) == net::OK; |
| 147 net::OK; | |
| 148 } | 147 } |
| 149 | 148 |
| 150 bool AwStaticCookiePolicy::AllowGet(const GURL& url, | 149 bool AwStaticCookiePolicy::AllowGet(const GURL& url, |
| 151 const GURL& first_party) const { | 150 const GURL& first_party) const { |
| 152 return StaticCookiePolicy(GetPolicy(url)).CanGetCookies(url, first_party) == | 151 return StaticCookiePolicy(GetPolicy(url)) |
| 153 net::OK; | 152 .CanAccessCookies(url, first_party) == net::OK; |
| 154 } | 153 } |
| 155 | 154 |
| 156 } // namespace android_webview | 155 } // namespace android_webview |
| OLD | NEW |