2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_
|
|
|
|
|
|
|
|
#include "include/cef_cookie.h"
|
2013-02-27 18:56:03 +01:00
|
|
|
#include "base/files/file_path.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "net/cookies/cookie_monster.h"
|
|
|
|
|
|
|
|
// Implementation of the CefCookieManager interface.
|
|
|
|
class CefCookieManagerImpl : public CefCookieManager {
|
|
|
|
public:
|
|
|
|
CefCookieManagerImpl(bool is_global);
|
|
|
|
~CefCookieManagerImpl();
|
|
|
|
|
|
|
|
// Initialize the cookie manager.
|
2013-02-13 20:53:41 +01:00
|
|
|
void Initialize(const CefString& path,
|
|
|
|
bool persist_session_cookies);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CefCookieManager methods.
|
2012-04-04 00:14:28 +02:00
|
|
|
virtual void SetSupportedSchemes(const std::vector<CefString>& schemes)
|
|
|
|
OVERRIDE;
|
2012-04-03 03:34:16 +02:00
|
|
|
virtual bool VisitAllCookies(CefRefPtr<CefCookieVisitor> visitor) OVERRIDE;
|
|
|
|
virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly,
|
|
|
|
CefRefPtr<CefCookieVisitor> visitor) OVERRIDE;
|
|
|
|
virtual bool SetCookie(const CefString& url,
|
|
|
|
const CefCookie& cookie) OVERRIDE;
|
|
|
|
virtual bool DeleteCookies(const CefString& url,
|
|
|
|
const CefString& cookie_name) OVERRIDE;
|
2013-02-13 20:53:41 +01:00
|
|
|
virtual bool SetStoragePath(const CefString& path,
|
|
|
|
bool persist_session_cookies) OVERRIDE;
|
2014-02-05 21:35:45 +01:00
|
|
|
virtual bool FlushStore(CefRefPtr<CefCompletionCallback> callback) OVERRIDE;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
net::CookieMonster* cookie_monster() { return cookie_monster_; }
|
|
|
|
|
2012-08-04 02:59:58 +02:00
|
|
|
static bool GetCefCookie(const net::CanonicalCookie& cc, CefCookie& cookie);
|
2012-06-19 18:29:49 +02:00
|
|
|
static bool GetCefCookie(const GURL& url, const std::string& cookie_line,
|
|
|
|
CefCookie& cookie);
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
private:
|
|
|
|
void SetGlobal();
|
|
|
|
|
|
|
|
scoped_refptr<net::CookieMonster> cookie_monster_;
|
|
|
|
bool is_global_;
|
2013-02-23 01:43:28 +01:00
|
|
|
base::FilePath storage_path_;
|
2012-06-19 18:29:49 +02:00
|
|
|
std::vector<CefString> supported_schemes_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefCookieManagerImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_COOKIE_MANAGER_IMPL_H_
|