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

Unified Diff: chrome/browser/extensions/extension_cookies_helpers.cc

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 years, 4 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/extension_cookies_helpers.cc
diff --git a/chrome/browser/extensions/extension_cookies_helpers.cc b/chrome/browser/extensions/extension_cookies_helpers.cc
index 2aedb5f800da82049e10666c4043660aa00cfcde..52368e964b736085bd20e5edf53d5256c72a9218 100644
--- a/chrome/browser/extensions/extension_cookies_helpers.cc
+++ b/chrome/browser/extensions/extension_cookies_helpers.cc
@@ -27,9 +27,11 @@ Profile* ChooseProfileFromStoreId(const std::string& store_id,
Profile* profile,
bool include_incognito) {
DCHECK(profile);
- if (store_id == kOriginalProfileStoreId)
+ bool allow_original = !profile->IsOffTheRecord();
+ bool allow_incognito = profile->IsOffTheRecord() || include_incognito;
+ if (store_id == kOriginalProfileStoreId && allow_original)
return profile->GetOriginalProfile();
- if (store_id == kOffTheRecordProfileStoreId && include_incognito)
+ if (store_id == kOffTheRecordProfileStoreId && allow_incognito)
return profile->GetOffTheRecordProfile();
return NULL;
}
« no previous file with comments | « chrome/browser/extensions/extension_cookies_api.cc ('k') | chrome/browser/extensions/extension_cookies_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698