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

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

Issue 22253010: Fix unwanted sign in to Chrome when the user signs in to another service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 7 years, 4 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 17f25190018cee91d5b7e48962f19c5d627de6ea..cbd56463f8e6cb10a14a60d2eda254e6dc46ab25 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -1052,9 +1052,9 @@ void OneClickSigninHelper::NavigateToPendingEntry(
void OneClickSigninHelper::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
- // If we navigate to a non-sign-in URL, make sure that the renderer process
- // is no longer considered the trusted sign-in process.
if (!SigninManager::IsWebBasedSigninFlowURL(params.url)) {
+ // Make sure the renderer process is no longer considered the trusted
+ // sign-in process when a navigation to a non-sign-in URL occurs.
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
SigninManager* manager = profile ?
@@ -1062,6 +1062,13 @@ void OneClickSigninHelper::DidNavigateMainFrame(
int process_id = web_contents()->GetRenderProcessHost()->GetID();
if (manager && manager->IsSigninProcess(process_id))
manager->ClearSigninProcess();
+
+ // If the navigation to a non-sign-in URL hasn't been triggered by the web
+ // contents, the sign in flow has been aborted and the state must be
+ // cleaned (crbug.com/269421).
+ if (!content::PageTransitionIsWebTriggerable(params.transition) &&
+ auto_accept_ != AUTO_ACCEPT_NONE)
fdoray 2013/08/09 14:32:25 CleanTransientState() cannot be executed in a unit
(NOT FOR CODE REVIEWS) 2013/08/09 14:43:04 Is it only for tests? Can you set do_not_clear_pe
fdoray 2013/08/09 17:42:14 It's for tests, but it also avoids unnecessary cal
+ CleanTransientState();
(NOT FOR CODE REVIEWS) 2013/08/09 14:43:04 Should add { and } to this if statement since cond
fdoray 2013/08/09 17:42:14 Done.
}
}
« 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