diff options
Diffstat (limited to 'android_webview/native/cookie_manager.cc')
-rw-r--r-- | android_webview/native/cookie_manager.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/android_webview/native/cookie_manager.cc b/android_webview/native/cookie_manager.cc index 310cb43..adb0ec8 100644 --- a/android_webview/native/cookie_manager.cc +++ b/android_webview/native/cookie_manager.cc @@ -96,6 +96,8 @@ class CookieManager { void SetAcceptCookie(bool accept); bool AcceptCookie(); + void SetAcceptThirdPartyCookie(bool accept); + bool AcceptThirdPartyCookie(); void SetCookie(const GURL& host, const std::string& cookie_value); std::string GetCookie(const GURL& host); void RemoveSessionCookie(); @@ -273,6 +275,14 @@ bool CookieManager::AcceptCookie() { return AwCookieAccessPolicy::GetInstance()->GetGlobalAllowAccess(); } +void CookieManager::SetAcceptThirdPartyCookie(bool accept) { + AwCookieAccessPolicy::GetInstance()->SetThirdPartyAllowAccess(accept); +} + +bool CookieManager::AcceptThirdPartyCookie() { + return AwCookieAccessPolicy::GetInstance()->GetThirdPartyAllowAccess(); +} + void CookieManager::SetCookie(const GURL& host, const std::string& cookie_value) { ExecCookieTask(base::Bind(&CookieManager::SetCookieAsyncHelper, @@ -447,6 +457,16 @@ static jboolean AcceptCookie(JNIEnv* env, jobject obj) { return CookieManager::GetInstance()->AcceptCookie(); } +static void SetAcceptThirdPartyCookie(JNIEnv* env, + jobject obj, + jboolean accept) { + CookieManager::GetInstance()->SetAcceptThirdPartyCookie(accept); +} + +static jboolean AcceptThirdPartyCookie(JNIEnv* env, jobject obj) { + return CookieManager::GetInstance()->AcceptThirdPartyCookie(); +} + static void SetCookie(JNIEnv* env, jobject obj, jstring url, jstring value) { GURL host(ConvertJavaStringToUTF16(env, url)); std::string cookie_value(ConvertJavaStringToUTF8(env, value)); |