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; |