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 7a898bad89ee47a1e4956eb38230e2c40297c99f..794cef0ea4b7db22b0bea35aae03763155a563bd 100644 |
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc |
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc |
@@ -502,6 +502,7 @@ void OneClickInfoBarDelegateImpl::RecordHistogramAction(int action) { |
OneClickSigninHelper::OneClickSigninHelper(content::WebContents* web_contents) |
: content::WebContentsObserver(web_contents), |
+ showing_signin_(false), |
auto_accept_(AUTO_ACCEPT_NONE), |
source_(SyncPromoUI::SOURCE_UNKNOWN) { |
} |
@@ -840,15 +841,6 @@ void OneClickSigninHelper::ShowInfoBarUIThread( |
if (!helper) |
return; |
- // 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 (!session_index.empty()) |
- helper->session_index_ = session_index; |
- |
- if (!email.empty()) |
- helper->email_ = email; |
- |
if (auto_accept != AUTO_ACCEPT_NONE) { |
helper->auto_accept_ = auto_accept; |
helper->source_ = source; |
@@ -869,6 +861,15 @@ void OneClickSigninHelper::ShowInfoBarUIThread( |
return; |
} |
+ // 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 (!session_index.empty()) |
+ helper->session_index_ = session_index; |
+ |
+ if (!email.empty()) |
+ helper->email_ = email; |
+ |
if (continue_url.is_valid()) |
helper->continue_url_ = continue_url; |
} |
@@ -916,6 +917,7 @@ void OneClickSigninHelper::RedirectToSignin() { |
void OneClickSigninHelper::CleanTransientState() { |
VLOG(1) << "OneClickSigninHelper::CleanTransientState"; |
+ showing_signin_ = false; |
email_.clear(); |
password_.clear(); |
auto_accept_ = AUTO_ACCEPT_NONE; |
@@ -973,6 +975,15 @@ void OneClickSigninHelper::DidStopLoading( |
return; |
} |
+ if ((StartsWithASCII(url.spec(), GaiaUrls::GetInstance()->service_login_url(), |
+ false) && |
+ source_ != SyncPromoUI::SOURCE_UNKNOWN) || |
+ !email_.empty()) { |
+ if (!showing_signin_) |
+ LOG(INFO) << "OneClickSigninHelper::DidStopLoading: doing da login"; |
+ showing_signin_ = true; |
+ } |
Roger Tawa OOO till Jul 10th
2013/02/27 20:43:22
To compare the urls, it might be better to do the
jwd
2013/02/28 15:55:45
Done.
|
+ |
// When Gaia finally redirects to the continue URL, Gaia will add some |
// extra query parameters. So ignore the parameters when checking to see |
// if the user has continued. |
@@ -986,6 +997,7 @@ void OneClickSigninHelper::DidStopLoading( |
// If there is no valid email or password yet, there is nothing to do. |
if (email_.empty() || password_.empty()) { |
+ VLOG(1) << "OneClickSigninHelper::DidStopLoading: nothing to do"; |
if (continue_url_match_accept) |
RedirectToSignin(); |
std::string unused_value; |