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

Unified Diff: chrome/browser/ui/android/infobars/auto_login_prompter.cc

Issue 309773003: Do not do infobar auto login in Incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix empty lines Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/auto_login_prompter.cc
diff --git a/chrome/browser/ui/android/infobars/auto_login_prompter.cc b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
index 7d50998db20e2d753ba7720f2004ac064baed927..915fd40f22b69800773c13eb353762491e986634 100644
--- a/chrome/browser/ui/android/infobars/auto_login_prompter.cc
+++ b/chrome/browser/ui/android/infobars/auto_login_prompter.cc
@@ -24,6 +24,7 @@
#include "url/gurl.h"
using content::BrowserThread;
+using content::BrowserContext;
using content::WebContents;
AutoLoginPrompter::AutoLoginPrompter(WebContents* web_contents,
@@ -73,9 +74,11 @@ void AutoLoginPrompter::ShowInfoBarUIThread(Params params,
if (!web_contents)
return;
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ BrowserContext* context = web_contents->GetBrowserContext();
+ if (context->IsOffTheRecord())
+ return;
+ Profile* profile = Profile::FromBrowserContext(context);
if (!profile->GetPrefs()->GetBoolean(prefs::kAutologinEnabled))
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698