| 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 580749f0ce7b258e9a64e199996e303737b3007a..c202f25e908b99cb1610f971cc84d4acce074484 100644
|
| --- a/chrome/browser/ui/sync/one_click_signin_helper.cc
|
| +++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
|
| @@ -499,7 +499,8 @@ OneClickSigninHelper::OneClickSigninHelper(content::WebContents* web_contents)
|
| switched_to_advanced_(false),
|
| original_source_(SyncPromoUI::SOURCE_UNKNOWN),
|
| untrusted_navigations_since_signin_visit_(0),
|
| - untrusted_confirmation_required_(false) {
|
| + untrusted_confirmation_required_(false),
|
| + do_not_clear_pending_email_(false) {
|
| }
|
|
|
| OneClickSigninHelper::~OneClickSigninHelper() {
|
| @@ -951,12 +952,14 @@ void OneClickSigninHelper::CleanTransientState() {
|
| error_message_.clear();
|
|
|
| // Post to IO thread to clear pending email.
|
| - Profile* profile =
|
| - Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
| - content::BrowserThread::PostTask(
|
| - content::BrowserThread::IO, FROM_HERE,
|
| - base::Bind(&ClearPendingEmailOnIOThread,
|
| - base::Unretained(profile->GetResourceContext())));
|
| + if (!do_not_clear_pending_email_) {
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
| + content::BrowserThread::PostTask(
|
| + content::BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&ClearPendingEmailOnIOThread,
|
| + base::Unretained(profile->GetResourceContext())));
|
| + }
|
| }
|
|
|
| bool OneClickSigninHelper::OnMessageReceived(const IPC::Message& message) {
|
| @@ -984,6 +987,10 @@ bool OneClickSigninHelper::OnFormSubmitted(const content::PasswordForm& form) {
|
| return true;
|
| }
|
|
|
| +void OneClickSigninHelper::SetDoNotClearPendingEmailForTesting() {
|
| + do_not_clear_pending_email_ = true;
|
| +}
|
| +
|
| void OneClickSigninHelper::NavigateToPendingEntry(
|
| const GURL& url,
|
| content::NavigationController::ReloadType reload_type) {
|
|
|