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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 11437014: Fix crash when signing in to gaia from an incognito tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo in comments Created 8 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/ui/sync/one_click_signin_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index 2e4f90131c5015565c260ddd1d50cfe15524176e..8fb54c94cbee0b29401249fb2711819a616c98a3 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -681,6 +681,9 @@ void OneClickSigninHelper::ShowInfoBarUIThread(
// browser_test.
OneClickSigninHelper* helper =
OneClickSigninHelper::FromWebContents(web_contents);
+ if (!helper)
+ return;
+
int error_message_id = 0;
CanOfferFor can_offer_for =
@@ -700,17 +703,15 @@ void OneClickSigninHelper::ShowInfoBarUIThread(
// Save the email in the one-click signin manager. The manager may
// not exist if the contents is incognito or if the profile is already
// connected to a Google account.
- if (helper) {
- if (!session_index.empty())
- helper->session_index_ = session_index;
+ if (!session_index.empty())
+ helper->session_index_ = session_index;
- if (!email.empty())
- helper->email_ = email;
+ if (!email.empty())
+ helper->email_ = email;
- if (auto_accept != NO_AUTO_ACCEPT) {
- helper->auto_accept_ = auto_accept;
- helper->source_ = source;
- }
+ if (auto_accept != NO_AUTO_ACCEPT) {
+ helper->auto_accept_ = auto_accept;
+ helper->source_ = source;
}
}
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.h ('k') | chrome/browser/ui/sync/one_click_signin_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698