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

Unified Diff: chrome/browser/cookies_tree_model.h

Issue 3048002: Store creating url in origin nodes and use it for content settings. (Closed)
Patch Set: compilefix Created 10 years, 5 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/cocoa/cookies_window_controller_unittest.mm ('k') | chrome/browser/cookies_tree_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cookies_tree_model.h
diff --git a/chrome/browser/cookies_tree_model.h b/chrome/browser/cookies_tree_model.h
index 9019884c7abb237c120a2385251f030cdc17bb4a..7e6675aa74ed0901ee7bff9f24cde5510fba94b7 100644
--- a/chrome/browser/cookies_tree_model.h
+++ b/chrome/browser/cookies_tree_model.h
@@ -112,7 +112,7 @@ class CookieTreeRootNode : public CookieTreeNode {
explicit CookieTreeRootNode(CookiesTreeModel* model) : model_(model) {}
virtual ~CookieTreeRootNode() {}
- CookieTreeOriginNode* GetOrCreateOriginNode(const std::wstring& origin);
+ CookieTreeOriginNode* GetOrCreateOriginNode(const GURL& url);
// CookieTreeNode methods:
virtual CookiesTreeModel* GetModel() const { return model_; }
@@ -130,12 +130,10 @@ class CookieTreeRootNode : public CookieTreeNode {
// CookieTreeOriginNode -------------------------------------------------------
class CookieTreeOriginNode : public CookieTreeNode {
public:
- explicit CookieTreeOriginNode(const std::wstring& origin)
- : CookieTreeNode(origin),
- cookies_child_(NULL),
- databases_child_(NULL),
- local_storages_child_(NULL),
- appcaches_child_(NULL) {}
+ // Returns the origin node's title to use for a given URL.
+ static std::wstring TitleForUrl(const GURL& url);
+
+ explicit CookieTreeOriginNode(const GURL& url);
virtual ~CookieTreeOriginNode() {}
// CookieTreeNode methods:
@@ -149,8 +147,14 @@ class CookieTreeOriginNode : public CookieTreeNode {
CookieTreeDatabasesNode* GetOrCreateDatabasesNode();
CookieTreeLocalStoragesNode* GetOrCreateLocalStoragesNode();
CookieTreeAppCachesNode* GetOrCreateAppCachesNode();
+
+ // Creates an content exception for this origin of type
+ // CONTENT_SETTINGS_TYPE_COOKIES.
void CreateContentException(HostContentSettingsMap* content_settings,
- ContentSetting setting);
+ ContentSetting setting) const;
+
+ // True if a content exception can be created for this origin.
+ bool CanCreateContentException() const;
private:
// Pointers to the cookies, databases, local storage and appcache nodes.
@@ -163,6 +167,9 @@ class CookieTreeOriginNode : public CookieTreeNode {
CookieTreeLocalStoragesNode* local_storages_child_;
CookieTreeAppCachesNode* appcaches_child_;
+ // The URL for which this node was initially created.
+ GURL url_;
+
DISALLOW_COPY_AND_ASSIGN(CookieTreeOriginNode);
};
« no previous file with comments | « chrome/browser/cocoa/cookies_window_controller_unittest.mm ('k') | chrome/browser/cookies_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698