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

Unified Diff: chrome/browser/tab_contents/tab_specific_content_settings.cc

Issue 5318002: Also register read cookies in the content settings delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
Index: chrome/browser/tab_contents/tab_specific_content_settings.cc
diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.cc b/chrome/browser/tab_contents/tab_specific_content_settings.cc
index edafe6cd2f9e2d6d0ff46d24c8857d011e9d6130..5897649a7115645f4050ecccfe1809b3cde861d9 100644
--- a/chrome/browser/tab_contents/tab_specific_content_settings.cc
+++ b/chrome/browser/tab_contents/tab_specific_content_settings.cc
@@ -93,6 +93,30 @@ void TabSpecificContentSettings::OnContentAccessed(ContentSettingsType type) {
}
}
+void TabSpecificContentSettings::OnCookiesRead(
+ const GURL& url,
+ const net::CookieMonster::CookieList& cookie_list,
+ bool blocked_by_policy) {
+ LocalSharedObjectsContainer& container = blocked_by_policy ?
+ blocked_local_shared_objects_ : allowed_local_shared_objects_;
+ typedef net::CookieMonster::CookieList::const_iterator cookie_iterator;
+ for (cookie_iterator cookie = cookie_list.begin();
+ cookie != cookie_list.end(); ++cookie) {
+ container.cookies()->SetCookieWithDetails(url,
+ cookie->Name(),
+ cookie->Value(),
+ cookie->Domain(),
+ cookie->Path(),
+ cookie->ExpiryDate(),
+ cookie->IsSecure(),
+ cookie->IsHttpOnly());
+ }
+ if (blocked_by_policy)
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
+ else
+ OnContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES);
+}
+
void TabSpecificContentSettings::OnCookieAccessed(
const GURL& url, const std::string& cookie_line, bool blocked_by_policy) {
net::CookieOptions options;

Powered by Google App Engine
This is Rietveld 408576698