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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 17962003: Fix regression: only clear sign-in process for navigations in that process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/signin/signin_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/sync/one_click_signin_helper.h" 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 void OneClickSigninHelper::DidNavigateMainFrame( 994 void OneClickSigninHelper::DidNavigateMainFrame(
995 const content::LoadCommittedDetails& details, 995 const content::LoadCommittedDetails& details,
996 const content::FrameNavigateParams& params) { 996 const content::FrameNavigateParams& params) {
997 // If we navigate to a non-sign-in URL, make sure that the renderer process 997 // If we navigate to a non-sign-in URL, make sure that the renderer process
998 // is no longer considered the trusted sign-in process. 998 // is no longer considered the trusted sign-in process.
999 if (!SigninManager::IsWebBasedSigninFlowURL(params.url)) { 999 if (!SigninManager::IsWebBasedSigninFlowURL(params.url)) {
1000 Profile* profile = 1000 Profile* profile =
1001 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 1001 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
1002 SigninManager* manager = profile ? 1002 SigninManager* manager = profile ?
1003 SigninManagerFactory::GetForProfile(profile) : NULL; 1003 SigninManagerFactory::GetForProfile(profile) : NULL;
1004 if (manager) 1004 int process_id = web_contents()->GetRenderProcessHost()->GetID();
1005 if (manager && manager->IsSigninProcess(process_id))
1005 manager->ClearSigninProcess(); 1006 manager->ClearSigninProcess();
1006 } 1007 }
1007 } 1008 }
1008 1009
1009 void OneClickSigninHelper::DidStopLoading( 1010 void OneClickSigninHelper::DidStopLoading(
1010 content::RenderViewHost* render_view_host) { 1011 content::RenderViewHost* render_view_host) {
1011 // If the user left the sign in process, clear all members. 1012 // If the user left the sign in process, clear all members.
1012 // TODO(rogerta): might need to allow some youtube URLs. 1013 // TODO(rogerta): might need to allow some youtube URLs.
1013 content::WebContents* contents = web_contents(); 1014 content::WebContents* contents = web_contents();
1014 const GURL url = contents->GetURL(); 1015 const GURL url = contents->GetURL();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 contents->GetController().LoadURL(redirect_url_, 1259 contents->GetController().LoadURL(redirect_url_,
1259 content::Referrer(), 1260 content::Referrer(),
1260 content::PAGE_TRANSITION_AUTO_TOPLEVEL, 1261 content::PAGE_TRANSITION_AUTO_TOPLEVEL,
1261 std::string()); 1262 std::string());
1262 } 1263 }
1263 1264
1264 // Clear the redirect URL. 1265 // Clear the redirect URL.
1265 redirect_url_ = GURL(); 1266 redirect_url_ = GURL();
1266 sync_service->RemoveObserver(this); 1267 sync_service->RemoveObserver(this);
1267 } 1268 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698