| 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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 start_mode_ = response; | 385 start_mode_ = response; |
| 386 else if (start_mode_ == CONFIRM_SYNC_SETTINGS_FIRST) | 386 else if (start_mode_ == CONFIRM_SYNC_SETTINGS_FIRST) |
| 387 start_mode_ = SYNC_WITH_DEFAULT_SETTINGS; | 387 start_mode_ = SYNC_WITH_DEFAULT_SETTINGS; |
| 388 | 388 |
| 389 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 389 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 390 signin->CompletePendingSignin(); | 390 signin->CompletePendingSignin(); |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 | 393 |
| 394 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed( | 394 void OneClickSigninSyncStarter::OnSyncConfirmationUIClosed( |
| 395 LoginUIService::SyncConfirmationUIClosedResults results) { | 395 LoginUIService::SyncConfirmationUIClosedResult result) { |
| 396 | 396 |
| 397 if (switches::UsePasswordSeparatedSigninFlow()) { | 397 if (switches::UsePasswordSeparatedSigninFlow()) { |
| 398 // We didn't run this callback in AccountAddedToCookie so do it now. | 398 // We didn't run this callback in AccountAddedToCookie so do it now. |
| 399 if (!sync_setup_completed_callback_.is_null()) | 399 if (!sync_setup_completed_callback_.is_null()) |
| 400 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS); | 400 sync_setup_completed_callback_.Run(SYNC_SETUP_SUCCESS); |
| 401 } | 401 } |
| 402 | 402 |
| 403 switch (results) { | 403 switch (result) { |
| 404 case LoginUIService::CONFIGURE_SYNC_FIRST: | 404 case LoginUIService::CONFIGURE_SYNC_FIRST: |
| 405 content::RecordAction( | 405 content::RecordAction( |
| 406 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); | 406 base::UserMetricsAction("Signin_Signin_WithAdvancedSyncSettings")); |
| 407 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); | 407 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); |
| 408 break; | 408 break; |
| 409 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: { | 409 case LoginUIService::SYNC_WITH_DEFAULT_SETTINGS: { |
| 410 content::RecordAction( | 410 content::RecordAction( |
| 411 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); | 411 base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); |
| 412 ProfileSyncService* profile_sync_service = GetProfileSyncService(); | 412 ProfileSyncService* profile_sync_service = GetProfileSyncService(); |
| 413 if (profile_sync_service) | 413 if (profile_sync_service) |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 false /* user_gesture */); | 648 false /* user_gesture */); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void OneClickSigninSyncStarter::LoadContinueUrl() { | 651 void OneClickSigninSyncStarter::LoadContinueUrl() { |
| 652 web_contents()->GetController().LoadURL( | 652 web_contents()->GetController().LoadURL( |
| 653 continue_url_, | 653 continue_url_, |
| 654 content::Referrer(), | 654 content::Referrer(), |
| 655 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 655 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 656 std::string()); | 656 std::string()); |
| 657 } | 657 } |
| OLD | NEW |