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

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: updates 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 62f3646bad364d0f7833cb8965239476f1b4aab8..e15c667492b341bc6cb4a5b37556f13a1dbe86c4 100644
--- a/chrome/browser/tab_contents/tab_specific_content_settings.cc
+++ b/chrome/browser/tab_contents/tab_specific_content_settings.cc
@@ -93,6 +93,33 @@ void TabSpecificContentSettings::OnContentAccessed(ContentSettingsType type) {
}
}
+void TabSpecificContentSettings::OnCookiesRead(
+ const GURL& url,
+ net::CookieMonster* cookie_monster,
+ const net::CookieOptions& options,
+ bool blocked_by_policy) {
+ LocalSharedObjectsContainer& container = blocked_by_policy ?
+ blocked_local_shared_objects_ : allowed_local_shared_objects_;
+ net::CookieMonster::CookieList cookie_list =
+ cookie_monster->GetAllCookiesForURLWithOptions(url, options);
darin (slow to review) 2010/11/30 18:24:11 nit: indent by 4 spaces
darin (slow to review) 2010/11/30 18:24:11 it seems like the cookies that you fetch here coul
jochen (gone - plz use gerrit) 2010/12/03 16:02:32 Done.
+ 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,

Powered by Google App Engine
This is Rietveld 408576698