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

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

Issue 447883002: Make sure sync setup completes when signing in from the avatar bubble with modal warnings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/sync/one_click_signin_sync_starter.cc » ('j') | 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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); 1177 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername);
1178 1178
1179 if (!last_email.empty() && !gaia::AreEmailsSame(last_email, email)) { 1179 if (!last_email.empty() && !gaia::AreEmailsSame(last_email, email)) {
1180 // If the new email address is different from the email address that 1180 // If the new email address is different from the email address that
1181 // just signed in, show a confirmation dialog. 1181 // just signed in, show a confirmation dialog.
1182 1182
1183 // No need to display a second confirmation so pass false below. 1183 // No need to display a second confirmation so pass false below.
1184 // TODO(atwilson): Move this into OneClickSigninSyncStarter. 1184 // TODO(atwilson): Move this into OneClickSigninSyncStarter.
1185 // The tab modal dialog always executes its callback before |contents| 1185 // The tab modal dialog always executes its callback before |contents|
1186 // is deleted. 1186 // is deleted.
1187
1188 // If the user signs in from the new avatar bubble, the confirm email dialog
1189 // would dismiss the avatar bubble, thus it won't show any confirmation upon
1190 // sign in completes. This cofirmation dialog already mentions that user
Roger Tawa OOO till Jul 10th 2014/08/06 21:04:42 cofirmation --> confirmation
guohui 2014/08/06 21:19:44 Done.
1191 // data would be synced, thus we just start sync immediately.
1192 // TODO(guohui): add a sync settings link to allow user to configure sync
1193 // settings before sync starts.
1194 if (start_mode == OneClickSigninSyncStarter::CONFIRM_SYNC_SETTINGS_FIRST)
1195 start_mode = OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS;
1196
1187 Browser* browser = chrome::FindBrowserWithWebContents(contents); 1197 Browser* browser = chrome::FindBrowserWithWebContents(contents);
1188 ConfirmEmailDialogDelegate::AskForConfirmation( 1198 ConfirmEmailDialogDelegate::AskForConfirmation(
1189 contents, 1199 contents,
1190 last_email, 1200 last_email,
1191 email, 1201 email,
1192 base::Bind( 1202 base::Bind(
1193 &StartExplicitSync, 1203 &StartExplicitSync,
1194 StartSyncArgs(profile, browser, auto_accept, 1204 StartSyncArgs(profile, browser, auto_accept,
1195 session_index, email, password, 1205 session_index, email, password,
1196 refresh_token, 1206 refresh_token,
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 // If the web contents is showing a blank page and not about to be closed, 1622 // If the web contents is showing a blank page and not about to be closed,
1613 // redirect to the NTP or apps page. 1623 // redirect to the NTP or apps page.
1614 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && 1624 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) &&
1615 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { 1625 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) {
1616 RedirectToNtpOrAppsPage( 1626 RedirectToNtpOrAppsPage(
1617 web_contents(), 1627 web_contents(),
1618 signin::GetSourceForPromoURL(original_continue_url_)); 1628 signin::GetSourceForPromoURL(original_continue_url_));
1619 } 1629 }
1620 } 1630 }
1621 } 1631 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/sync/one_click_signin_sync_starter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698