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

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

Issue 14197014: Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 7 years, 6 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
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 37c35959f85ff7daf5cf78df47389467ec2e4849..c4c4eb24c76db59a4ee6fdc5a4b61c937e512027 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -496,7 +496,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() {
@@ -948,12 +949,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) {
@@ -981,6 +984,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) {
« 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