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

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

Issue 1868273002: Enhanced Sync Confirmation modal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dan's comments + rebase Created 4 years, 8 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
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_sync_starter.h" 5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 start_mode_ = response; 383 start_mode_ = response;
384 else if (start_mode_ == CONFIRM_SYNC_SETTINGS_FIRST) 384 else if (start_mode_ == CONFIRM_SYNC_SETTINGS_FIRST)
385 start_mode_ = SYNC_WITH_DEFAULT_SETTINGS; 385 start_mode_ = SYNC_WITH_DEFAULT_SETTINGS;
386 386
387 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); 387 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
388 signin->CompletePendingSignin(); 388 signin->CompletePendingSignin();
389 } 389 }
390 } 390 }
391 391
392 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed( 392 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed(
393 LoginUIService::SyncConfirmationUIClosedResults results) { 393 LoginUIService::SyncConfirmationUIClosedResult result) {
394 394
395 if (switches::UsePasswordSeparatedSigninFlow()) { 395 if (switches::UsePasswordSeparatedSigninFlow()) {
396 // We didn't run this callback in AccountAddedToCookie so do it now. 396 // We didn't run this callback in AccountAddedToCookie so do it now.
397 if (!sync_setup_completed_callback_.is_null()) 397 if (!sync_setup_completed_callback_.is_null())
398 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS); 398 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS);
399 } 399 }
400 400
401 switch (results) { 401 switch (result) {
402 case LoginUIService::CONFIGURE_SYNC_FIRST: 402 case LoginUIService::CONFIGURE_SYNC_FIRST:
403 content::RecordAction( 403 content::RecordAction(
404 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); 404 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings"));
405 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); 405 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
406 break; 406 break;
407 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: { 407 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: {
408 content::RecordAction( 408 content::RecordAction(
409 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); 409 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings"));
410 ProfileSyncService* profile_sync_service = GetProfileSyncService(); 410 ProfileSyncService* profile_sync_service = GetProfileSyncService();
411 if (profile_sync_service) 411 if (profile_sync_service)
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 false /* user_gesture */); 646 false /* user_gesture */);
647 } 647 }
648 648
649 void OneClickSigninSyncStarter::LoadContinueUrl() { 649 void OneClickSigninSyncStarter::LoadContinueUrl() {
650 web_contents()->GetController().LoadURL( 650 web_contents()->GetController().LoadURL(
651 continue_url_, 651 continue_url_,
652 content::Referrer(), 652 content::Referrer(),
653 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 653 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
654 std::string()); 654 std::string());
655 } 655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698