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

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

Issue 2800683008: Sync confirmation: change "Settings" link to checkbox (Closed)
Patch Set: tests Created 3 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_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 if (switches::UsePasswordSeparatedSigninFlow()) { 421 if (switches::UsePasswordSeparatedSigninFlow()) {
422 // We didn't run this callback in AccountAddedToCookie so do it now. 422 // We didn't run this callback in AccountAddedToCookie so do it now.
423 if (!sync_setup_completed_callback_.is_null()) 423 if (!sync_setup_completed_callback_.is_null())
424 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS); 424 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS);
425 } 425 }
426 426
427 switch (result) { 427 switch (result) {
428 case LoginUIService::CONFIGURE_SYNC_FIRST: 428 case LoginUIService::CONFIGURE_SYNC_FIRST:
429 base::RecordAction( 429 base::RecordAction(
430 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); 430 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings"));
431 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); 431 ShowSyncSetupSettingsSubpage();
432 break; 432 break;
433 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: { 433 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: {
434 base::RecordAction( 434 base::RecordAction(
435 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); 435 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings"));
436 ProfileSyncService* profile_sync_service = GetProfileSyncService(); 436 ProfileSyncService* profile_sync_service = GetProfileSyncService();
437 if (profile_sync_service) 437 if (profile_sync_service)
438 profile_sync_service->SetFirstSetupComplete(); 438 profile_sync_service->SetFirstSetupComplete();
439 FinishProfileSyncServiceSetup(); 439 FinishProfileSyncServiceSetup();
440 break; 440 break;
441 } 441 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 browser = chrome::FindLastActiveWithProfile(profile); 566 browser = chrome::FindLastActiveWithProfile(profile);
567 if (!browser) { 567 if (!browser) {
568 browser = new Browser(Browser::CreateParams(profile, true)); 568 browser = new Browser(Browser::CreateParams(profile, true));
569 chrome::AddTabAt(browser, GURL(), -1, true); 569 chrome::AddTabAt(browser, GURL(), -1, true);
570 } 570 }
571 browser->window()->Show(); 571 browser->window()->Show();
572 } 572 }
573 return browser; 573 return browser;
574 } 574 }
575 575
576 void OneClickSigninSyncStarter::ShowSyncSetupSettingsSubpage() {
577 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
578 }
579
576 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) { 580 void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) {
577 // Give the user a chance to configure things. We don't clear the 581 // Give the user a chance to configure things. We don't clear the
578 // ProfileSyncService::setup_in_progress flag because we don't want sync 582 // ProfileSyncService::setup_in_progress flag because we don't want sync
579 // to start up until after the configure UI is displayed (the configure UI 583 // to start up until after the configure UI is displayed (the configure UI
580 // will clear the flag when the user is done setting up sync). 584 // will clear the flag when the user is done setting up sync).
581 ProfileSyncService* profile_sync_service = GetProfileSyncService(); 585 ProfileSyncService* profile_sync_service = GetProfileSyncService();
582 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); 586 LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_);
583 if (login_ui->current_login_ui()) { 587 if (login_ui->current_login_ui()) {
584 login_ui->current_login_ui()->FocusUI(); 588 login_ui->current_login_ui()->FocusUI();
585 } else { 589 } else {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 false /* user_gesture */); 671 false /* user_gesture */);
668 } 672 }
669 673
670 void OneClickSigninSyncStarter::LoadContinueUrl() { 674 void OneClickSigninSyncStarter::LoadContinueUrl() {
671 web_contents()->GetController().LoadURL( 675 web_contents()->GetController().LoadURL(
672 continue_url_, 676 continue_url_,
673 content::Referrer(), 677 content::Referrer(),
674 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 678 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
675 std::string()); 679 std::string());
676 } 680 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | chrome/browser/ui/webui/signin/sync_confirmation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698