Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3971)

Unified Diff: chrome/browser/net/chrome_url_request_context.h

Issue 556095: Changes to support new cookie policy.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/host_content_settings_map.cc ('k') | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_url_request_context.h
===================================================================
--- chrome/browser/net/chrome_url_request_context.h (revision 37613)
+++ chrome/browser/net/chrome_url_request_context.h (working copy)
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "base/linked_ptr.h"
+#include "net/base/cookie_policy.h"
#include "chrome/browser/host_content_settings_map.h"
#include "chrome/browser/host_zoom_map.h"
#include "chrome/browser/privacy_blacklist/blacklist.h"
@@ -33,7 +34,8 @@
//
// All methods of this class must be called from the IO thread,
// including the constructor and destructor.
-class ChromeURLRequestContext : public URLRequestContext {
+class ChromeURLRequestContext : public URLRequestContext,
+ public net::CookiePolicy {
public:
// Maintains some extension-related state we need on the IO thread.
// TODO(aa): It would be cool if the Extension objects in ExtensionsService
@@ -111,13 +113,18 @@
// Callback for when new extensions are loaded. Takes ownership of
// |extension_info|.
- void OnNewExtensions(
- const std::string& id,
- ChromeURLRequestContext::ExtensionInfo* extension_info);
+ void OnNewExtensions(const std::string& id, ExtensionInfo* extension_info);
// Callback for when an extension is unloaded.
void OnUnloadedExtension(const std::string& id);
+ // False only if cookies are globally blocked without exception.
+ bool AreCookiesEnabled() const;
+
+ // CookiePolicy methods:
+ virtual bool CanGetCookies(const GURL& url, const GURL& first_party);
+ virtual bool CanSetCookie(const GURL& url, const GURL& first_party);
+
protected:
// Copies the dependencies from |other| into |this|. If you use this
// constructor, then you should hold a reference to |other|, as we
@@ -137,9 +144,6 @@
void set_referrer_charset(const std::string& referrer_charset) {
referrer_charset_ = referrer_charset;
}
- void set_cookie_policy_type(net::CookiePolicy::Type type) {
- cookie_policy_.set_type(type);
- }
void set_extension_info(
const ChromeURLRequestContext::ExtensionInfoMap& info) {
extension_info_ = info;
@@ -192,9 +196,6 @@
// Callback for when the accept language changes.
void OnAcceptLanguageChange(const std::string& accept_language);
- // Callback for when the cookie policy changes.
- void OnCookiePolicyChange(net::CookiePolicy::Type type);
-
// Callback for when the default charset changes.
void OnDefaultCharsetChange(const std::string& default_charset);
@@ -316,7 +317,6 @@
// These methods simply forward to the corresponding method on
// ChromeURLRequestContext.
void OnAcceptLanguageChange(const std::string& accept_language);
- void OnCookiePolicyChange(net::CookiePolicy::Type type);
void OnDefaultCharsetChange(const std::string& default_charset);
// Saves the cookie store to |result| and signals |completion|.
@@ -370,7 +370,6 @@
std::string accept_language_;
std::string accept_charset_;
std::string referrer_charset_;
- net::CookiePolicy::Type cookie_policy_type_;
ChromeURLRequestContext::ExtensionInfoMap extension_info_;
// TODO(aa): I think this can go away now as we no longer support standalone
// user scripts.
« no previous file with comments | « chrome/browser/host_content_settings_map.cc ('k') | chrome/browser/net/chrome_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698