OLD | NEW |
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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 // tab. | 1180 // tab. |
1181 | 1181 |
1182 // No need to display a second confirmation so pass false below. | 1182 // No need to display a second confirmation so pass false below. |
1183 // TODO(atwilson): Move this into OneClickSigninSyncStarter. | 1183 // TODO(atwilson): Move this into OneClickSigninSyncStarter. |
1184 // The tab modal dialog always executes its callback before |contents| | 1184 // The tab modal dialog always executes its callback before |contents| |
1185 // is deleted. | 1185 // is deleted. |
1186 Browser* browser = chrome::FindLastActiveWithProfile( | 1186 Browser* browser = chrome::FindLastActiveWithProfile( |
1187 profile, chrome::GetActiveDesktop()); | 1187 profile, chrome::GetActiveDesktop()); |
1188 content::WebContents* contents = | 1188 content::WebContents* contents = |
1189 browser->tab_strip_model()->GetActiveWebContents(); | 1189 browser->tab_strip_model()->GetActiveWebContents(); |
| 1190 |
| 1191 // If the user signs in from the new avatar bubble, the confirm email dialog |
| 1192 // would dismiss the avatar bubble, thus it won't show any confirmation upon |
| 1193 // sign in completes. This confirmation dialog already mentions that user |
| 1194 // data would be synced, thus we just start sync immediately. |
| 1195 // TODO(guohui): add a sync settings link to allow user to configure sync |
| 1196 // settings before sync starts. |
| 1197 if (start_mode == OneClickSigninSyncStarter::CONFIRM_SYNC_SETTINGS_FIRST) |
| 1198 start_mode = OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS; |
| 1199 |
1190 ConfirmEmailDialogDelegate::AskForConfirmation( | 1200 ConfirmEmailDialogDelegate::AskForConfirmation( |
1191 contents, | 1201 contents, |
1192 last_email, | 1202 last_email, |
1193 email, | 1203 email, |
1194 base::Bind( | 1204 base::Bind( |
1195 &StartExplicitSync, | 1205 &StartExplicitSync, |
1196 StartSyncArgs(profile, browser, auto_accept, | 1206 StartSyncArgs(profile, browser, auto_accept, |
1197 session_index, email, password, | 1207 session_index, email, password, |
1198 refresh_token, | 1208 refresh_token, |
1199 contents, false /* confirmation_required */, source, | 1209 contents, false /* confirmation_required */, source, |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 // If the web contents is showing a blank page and not about to be closed, | 1624 // If the web contents is showing a blank page and not about to be closed, |
1615 // redirect to the NTP or apps page. | 1625 // redirect to the NTP or apps page. |
1616 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1626 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
1617 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1627 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
1618 RedirectToNtpOrAppsPage( | 1628 RedirectToNtpOrAppsPage( |
1619 web_contents(), | 1629 web_contents(), |
1620 signin::GetSourceForPromoURL(original_continue_url_)); | 1630 signin::GetSourceForPromoURL(original_continue_url_)); |
1621 } | 1631 } |
1622 } | 1632 } |
1623 } | 1633 } |
OLD | NEW |