OLD | NEW |
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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed( | 411 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed( |
412 bool configure_sync_first) { | 412 bool configure_sync_first) { |
413 if (configure_sync_first) { | 413 if (configure_sync_first) { |
414 content::RecordAction( | 414 content::RecordAction( |
415 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); | 415 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); |
416 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); | 416 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); |
417 } else { | 417 } else { |
418 content::RecordAction( | 418 content::RecordAction( |
419 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); | 419 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); |
420 ProfileSyncService* profile_sync_service = GetProfileSyncService(); | 420 ProfileSyncService* profile_sync_service = GetProfileSyncService(); |
421 if (profile_sync_service) | 421 if (profile_sync_service) { |
422 profile_sync_service->SetFirstSetupComplete(); | 422 profile_sync_service->SetFirstSetupComplete(); |
| 423 profile_sync_service->RequestStart(); |
| 424 } |
423 FinishProfileSyncServiceSetup(); | 425 FinishProfileSyncServiceSetup(); |
424 } | 426 } |
425 | 427 |
426 delete this; | 428 delete this; |
427 } | 429 } |
428 | 430 |
429 void OneClickSigninSyncStarter::SigninFailed( | 431 void OneClickSigninSyncStarter::SigninFailed( |
430 const GoogleServiceAuthError& error) { | 432 const GoogleServiceAuthError& error) { |
431 if (!sync_setup_completed_callback_.is_null()) | 433 if (!sync_setup_completed_callback_.is_null()) |
432 sync_setup_completed_callback_.Run(SYNC_SETUP_FAILURE); | 434 sync_setup_completed_callback_.Run(SYNC_SETUP_FAILURE); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 false /* user_gesture */); | 638 false /* user_gesture */); |
637 } | 639 } |
638 | 640 |
639 void OneClickSigninSyncStarter::LoadContinueUrl() { | 641 void OneClickSigninSyncStarter::LoadContinueUrl() { |
640 web_contents()->GetController().LoadURL( | 642 web_contents()->GetController().LoadURL( |
641 continue_url_, | 643 continue_url_, |
642 content::Referrer(), | 644 content::Referrer(), |
643 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 645 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
644 std::string()); | 646 std::string()); |
645 } | 647 } |
OLD | NEW |