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
3 // found in the LICENSE file.
5 #include "android_webview/lib/aw_content_browser_client.h"
7 #include "android_webview/browser/aw_cookie_access_policy.h"
8 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h"
10 namespace android_webview
{
12 AwContentBrowserClient::AwContentBrowserClient()
13 : ChromeContentBrowserClient() {
16 AwContentBrowserClient::~AwContentBrowserClient() {
19 void AwContentBrowserClient::ResourceDispatcherHostCreated() {
20 ChromeContentBrowserClient::ResourceDispatcherHostCreated();
21 AwResourceDispatcherHostDelegate::ResourceDispatcherHostCreated();
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
,
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
,
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
,
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
,
58 } // namespace android_webview