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

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

Issue 5742011: Do not create an incognito profile if none exists in cookies.getAllCookieStores (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/extensions
Patch Set: Created 10 years 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 acd58e6e1831db7651715f201749d59a9220b857..42e2fae4ef6448413b2b6adaa3eb9253595fd1a1 100644
--- a/chrome/browser/extensions/extension_cookies_helpers.cc
+++ b/chrome/browser/extensions/extension_cookies_helpers.cc
@@ -30,7 +30,8 @@ Profile* ChooseProfileFromStoreId(const std::string& store_id,
bool include_incognito) {
DCHECK(profile);
bool allow_original = !profile->IsOffTheRecord();
- bool allow_incognito = profile->IsOffTheRecord() || include_incognito;
+ bool allow_incognito = profile->IsOffTheRecord() ||
+ (include_incognito && profile->HasOffTheRecordProfile());
if (store_id == kOriginalProfileStoreId && allow_original)
return profile->GetOriginalProfile();
if (store_id == kOffTheRecordProfileStoreId && allow_incognito)
« 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