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

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

Issue 17482002: Display confirmation dialog for untrusted signins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index b05a72763627645bfc89a05ee9509621b12456c6..37001a46cf8f6c9151ec6291320fb9ba30b63575 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -48,10 +48,12 @@ OneClickSigninSyncStarter::OneClickSigninSyncStarter(
const std::string& password,
StartSyncMode start_mode,
bool force_same_tab_navigation,
- ConfirmationRequired confirmation_required)
+ ConfirmationRequired confirmation_required,
+ SyncPromoUI::Source source)
: start_mode_(start_mode),
force_same_tab_navigation_(force_same_tab_navigation),
confirmation_required_(confirmation_required),
+ source_(source),
weak_pointer_factory_(this) {
DCHECK(profile);
BrowserList::AddObserver(this);
@@ -312,6 +314,16 @@ void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
StartSyncMode response) {
if (response == UNDO_SYNC) {
CancelSigninAndDelete();
+ // If this was not an interstitial signin, (i.e. it was a SAML signin)
+ // then the browser page is now blank and should redirect to the NTP.
+ if (source_ != SyncPromoUI::SOURCE_UNKNOWN) {
+ EnsureBrowser();
+ chrome::NavigateParams params(browser_, GURL(chrome::kChromeUINewTabURL),
+ content::PAGE_TRANSITION_AUTO_TOPLEVEL);
+ params.disposition = CURRENT_TAB;
+ params.window_action = chrome::NavigateParams::SHOW_WINDOW;
+ chrome::Navigate(&params);
+ }
} else {
// If the user clicked the "Advanced" link in the confirmation dialog, then
// override the current start_mode_ to bring up the advanced sync settings.

Powered by Google App Engine
This is Rietveld 408576698