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/lib/aw_content_browser_client.h" | 5 #include "android_webview/lib/aw_content_browser_client.h" |
6 | 6 |
| 7 #include "android_webview/browser/aw_cookie_access_policy.h" |
7 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 8 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
8 | 9 |
9 namespace android_webview { | 10 namespace android_webview { |
10 | 11 |
11 AwContentBrowserClient::AwContentBrowserClient() | 12 AwContentBrowserClient::AwContentBrowserClient() |
12 : ChromeContentBrowserClient() { | 13 : ChromeContentBrowserClient() { |
13 } | 14 } |
14 | 15 |
15 AwContentBrowserClient::~AwContentBrowserClient() { | 16 AwContentBrowserClient::~AwContentBrowserClient() { |
16 } | 17 } |
17 | 18 |
18 void AwContentBrowserClient::ResourceDispatcherHostCreated() { | 19 void AwContentBrowserClient::ResourceDispatcherHostCreated() { |
19 ChromeContentBrowserClient::ResourceDispatcherHostCreated(); | 20 ChromeContentBrowserClient::ResourceDispatcherHostCreated(); |
20 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); | 21 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated(); |
21 } | 22 } |
22 | 23 |
| 24 bool AwContentBrowserClient::AllowGetCookie(const GURL& url, |
| 25 const GURL& first_party, |
| 26 const net::CookieList& cookie_list, |
| 27 content::ResourceContext* context, |
| 28 int render_process_id, |
| 29 int render_view_id) { |
| 30 // Not base-calling into ChromeContentBrowserClient as we are not dependent |
| 31 // on chrome/ for any cookie policy decisions. |
| 32 return AwCookieAccessPolicy::GetInstance()->AllowGetCookie(url, |
| 33 first_party, |
| 34 cookie_list, |
| 35 context, |
| 36 render_process_id, |
| 37 render_view_id); |
| 38 } |
| 39 |
| 40 bool AwContentBrowserClient::AllowSetCookie(const GURL& url, |
| 41 const GURL& first_party, |
| 42 const std::string& cookie_line, |
| 43 content::ResourceContext* context, |
| 44 int render_process_id, |
| 45 int render_view_id, |
| 46 net::CookieOptions* options) { |
| 47 // Not base-calling into ChromeContentBrowserClient as we are not dependent |
| 48 // on chrome/ for any cookie policy decisions. |
| 49 return AwCookieAccessPolicy::GetInstance()->AllowSetCookie(url, |
| 50 first_party, |
| 51 cookie_line, |
| 52 context, |
| 53 render_process_id, |
| 54 render_view_id, |
| 55 options); |
| 56 } |
| 57 |
23 } // namespace android_webview | 58 } // namespace android_webview |
OLD | NEW |