| 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 1a0018756b909abf365d7b7b48fcfbace712aa6a..2b11a5f5b84763a7f5d8c2f058d47ccb2b93a173 100644
|
| --- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
|
| +++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
|
| @@ -41,6 +41,7 @@
|
| #include "components/browser_sync/browser/profile_sync_service.h"
|
| #include "components/signin/core/browser/signin_manager.h"
|
| #include "components/signin/core/browser/signin_metrics.h"
|
| +#include "components/signin/core/common/profile_management_switches.h"
|
| #include "components/sync_driver/sync_prefs.h"
|
| #include "content/public/browser/user_metrics.h"
|
| #include "net/base/url_util.h"
|
| @@ -411,20 +412,25 @@ void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
|
| }
|
|
|
| void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed(
|
| - bool configure_sync_first) {
|
| - if (configure_sync_first) {
|
| - content::RecordAction(
|
| - base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings"));
|
| - chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
|
| - } else {
|
| - content::RecordAction(
|
| - base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings"));
|
| - ProfileSyncService* profile_sync_service = GetProfileSyncService();
|
| - if (profile_sync_service) {
|
| - profile_sync_service->SetFirstSetupComplete();
|
| - profile_sync_service->RequestStart();
|
| + LoginUIService::SyncConfirmationUIClosedResults results) {
|
| + switch (results) {
|
| + case LoginUIService::CONFIGURE_SYNC_FIRST:
|
| + content::RecordAction(
|
| + base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings"));
|
| + chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
|
| + break;
|
| + case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: {
|
| + content::RecordAction(
|
| + base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings"));
|
| + ProfileSyncService* profile_sync_service = GetProfileSyncService();
|
| + if (profile_sync_service)
|
| + profile_sync_service->SetFirstSetupComplete();
|
| + FinishProfileSyncServiceSetup();
|
| + break;
|
| }
|
| - FinishProfileSyncServiceSetup();
|
| + case LoginUIService::ABORT_SIGNIN:
|
| + FinishProfileSyncServiceSetup();
|
| + break;
|
| }
|
|
|
| delete this;
|
| @@ -491,8 +497,12 @@ void OneClickSigninSyncStarter::AccountAddedToCookie(
|
| break;
|
| }
|
| case CONFIRM_SYNC_SETTINGS_FIRST:
|
| - // Blocks sync until the sync settings confirmation UI is closed.
|
| - DisplayFinalConfirmationBubble(base::string16());
|
| + if (switches::UsePasswordSeparatedSigninFlow()) {
|
| + DisplayModalSyncConfirmationWindow();
|
| + } else {
|
| + // Blocks sync until the sync settings confirmation UI is closed.
|
| + DisplayFinalConfirmationBubble(base::string16());
|
| + }
|
| return;
|
| case CONFIGURE_SYNC_FIRST:
|
| ShowSettingsPage(true); // Show sync config UI.
|
| @@ -521,6 +531,11 @@ void OneClickSigninSyncStarter::DisplayFinalConfirmationBubble(
|
| DisplayLoginResult(browser_, custom_message);
|
| }
|
|
|
| +void OneClickSigninSyncStarter::DisplayModalSyncConfirmationWindow() {
|
| + browser_ = EnsureBrowser(browser_, profile_, desktop_type_);
|
| + browser_->window()->ShowModalSyncConfirmationWindow();
|
| +}
|
| +
|
| // static
|
| Browser* OneClickSigninSyncStarter::EnsureBrowser(
|
| Browser* browser,
|
|
|