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

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

Issue 1487283005: Implement the new Sync Confirmation dialog on Linux and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move strings to resources and properly enable the settings link. Created 5 years 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 61e6906612f8d85fedea7328cdf720a4e5eab0fb..53b1a2beab5d87d2987b6f81433a1b3071163913 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -39,6 +39,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 "net/url_request/url_request_context_getter.h"
#include "ui/base/l10n/l10n_util.h"
@@ -391,10 +392,10 @@ void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
}
void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed(
- bool configure_sync_first) {
- if (configure_sync_first) {
+ LoginUIService::SyncConfirmationUIClosedResults results) {
+ if (results == LoginUIService::CONFIGURE_SYNC_FIRST) {
chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
- } else {
+ } else if (results == LoginUIService::SYNC_WITH_DEFAULT_SETTINGS) {
ProfileSyncService* profile_sync_service = GetProfileSyncService();
if (profile_sync_service)
profile_sync_service->SetSyncSetupCompleted();
@@ -458,8 +459,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.
@@ -488,6 +493,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,

Powered by Google App Engine
This is Rietveld 408576698