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

Unified Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 2349823003: Pass a RemovalCause to CookieChangedCallback (Closed)
Patch Set: rebase Created 4 years, 3 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
Index: chrome/browser/extensions/api/cookies/cookies_api.cc
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index 16aabadf614b666cc6adf6e721de580570ba7195..549dd0e65510b6bd6226e9601c74280cd0071699 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -143,27 +143,30 @@ void CookiesEventRouter::CookieChanged(
// Map the internal cause to an external string.
std::string cause;
switch (details->cause) {
- case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT:
+ // Report an inserted cookie as an "explicit" change cause. All other causes
+ // only make sense for deletions.
+ case net::CookieStore::ChangeCause::INSERTED:
+ case net::CookieStore::ChangeCause::EXPLICIT:
cause = keys::kExplicitChangeCause;
break;
- case net::CookieMonsterDelegate::CHANGE_COOKIE_OVERWRITE:
+ case net::CookieStore::ChangeCause::OVERWRITE:
cause = keys::kOverwriteChangeCause;
break;
- case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED:
+ case net::CookieStore::ChangeCause::EXPIRED:
cause = keys::kExpiredChangeCause;
break;
- case net::CookieMonsterDelegate::CHANGE_COOKIE_EVICTED:
+ case net::CookieStore::ChangeCause::EVICTED:
cause = keys::kEvictedChangeCause;
break;
- case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED_OVERWRITE:
+ case net::CookieStore::ChangeCause::EXPIRED_OVERWRITE:
cause = keys::kExpiredOverwriteChangeCause;
break;
- default:
+ case net::CookieStore::ChangeCause::UNKNOWN_DELETION:
NOTREACHED();
}
dict->SetString(keys::kCauseKey, cause);
« no previous file with comments | « android_webview/browser/net/aw_cookie_store_wrapper.cc ('k') | chrome/browser/extensions/extension_cookie_monster_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698