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

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: Back to patch 7 + style fix 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 eb26b2088fbdf4e2af60563c1df8781131507824..85c679d52ccf64e6cb39eb3f2853182b32fd48d6 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -1050,9 +1050,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 ?
@@ -1060,6 +1060,14 @@ 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) {
+ CleanTransientState();
+ }
}
}
« 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