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

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

Issue 1806353002: Enhanced Sync Confirmation modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 6e500993f6b60a012e03222c1cc7a2993f201c6c..10876e1d118e723963d2739904630c915c7c9a34 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -398,12 +398,25 @@ void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed(
base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings"));
chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
break;
+ case LoginUIService::SYNC_WITH_ACTIVITY_CONTROLS: {
anthonyvd 2016/03/17 20:23:41 This code is probably changing a bit in https://co
Moe 2016/03/18 21:53:40 Acknowledged.
+ content::RecordAction(
+ base::UserMetricsAction("Signin_Signin_WithActivityControls"));
+ StartSync();
+ FinishProfileSyncServiceSetup();
+ // Open the 'Activity controls' section of the privacy settings page.
+ GURL url = GURL(chrome::kGoogleAccountActivityControlsURL);
+ content::OpenURLParams params(url,
+ content::Referrer(),
+ NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
+ false);
+ browser_->OpenURL(params);
+ 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();
+ StartSync();
FinishProfileSyncServiceSetup();
break;
}
@@ -460,13 +473,11 @@ void OneClickSigninSyncStarter::AccountAddedToCookie(
switch (start_mode_) {
case SYNC_WITH_DEFAULT_SETTINGS: {
// Just kick off the sync machine, no need to configure it first.
- ProfileSyncService* profile_sync_service = GetProfileSyncService();
- if (profile_sync_service)
- profile_sync_service->SetFirstSetupComplete();
+ StartSync();
FinishProfileSyncServiceSetup();
if (confirmation_required_ == CONFIRM_AFTER_SIGNIN) {
base::string16 message;
- if (!profile_sync_service) {
+ if (!GetProfileSyncService()) {
// Sync is disabled by policy.
message = l10n_util::GetStringUTF16(
IDS_ONE_CLICK_SIGNIN_BUBBLE_SYNC_DISABLED_MESSAGE);
@@ -599,6 +610,12 @@ ProfileSyncService* OneClickSigninSyncStarter::GetProfileSyncService() {
return service;
}
+void OneClickSigninSyncStarter::StartSync() {
anthonyvd 2016/03/17 20:23:41 I'd rename this to SetFirstSetupComplete or someth
Moe 2016/03/18 21:53:40 Done.
+ ProfileSyncService* profile_sync_service = GetProfileSyncService();
+ if (profile_sync_service)
+ profile_sync_service->SetFirstSetupComplete();
+}
+
void OneClickSigninSyncStarter::FinishProfileSyncServiceSetup() {
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile_);

Powered by Google App Engine
This is Rietveld 408576698