Chromium Code Reviews| Index: chrome/browser/chromeos/login/wizard_controller.cc |
| diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc |
| index f9c9ed29b1146bcf6777494594111164e2c0d858..f3a510caaeb76fbbe02e0d2e266571b642485995 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc |
| @@ -613,17 +613,10 @@ void WizardController::OnUpdateCompleted() { |
| void WizardController::OnEulaAccepted() { |
| time_eula_accepted_ = base::Time::Now(); |
| StartupUtils::MarkEulaAccepted(); |
| - bool uma_enabled = |
| - ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
| - |
| - CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); |
| - if (uma_enabled) { |
| -#if defined(GOOGLE_CHROME_BUILD) |
| - // The crash reporter initialization needs IO to complete. |
| - base::ThreadRestrictions::ScopedAllowIO allow_io; |
| - breakpad::InitCrashReporter(std::string()); |
| -#endif |
| - } |
| + base::Callback<void(bool)> callback_fn = base::Bind( |
| + &WizardController::InitiateMetricsReportingChangeCallback, |
| + weak_factory_.GetWeakPtr()); |
| + InitiateMetricsReportingChange(usage_statistics_reporting_, callback_fn); |
| if (skip_update_enroll_after_eula_) { |
| PerformPostEulaActions(); |
| @@ -633,6 +626,21 @@ void WizardController::OnEulaAccepted() { |
| } |
| } |
| +void WizardController::InitiateMetricsReportingChangeCallback(bool success) { |
| + if (!success) { |
|
Alexei Svitkine (slow)
2014/09/04 18:45:25
Nit: No need for {}'s for single line body.
gayane -on leave until 09-2017
2014/09/04 21:30:12
Done.
|
| + return; |
| + } |
| + CrosSettings::Get()->SetBoolean(kStatsReportingPref, |
| + usage_statistics_reporting_); |
| + if (usage_statistics_reporting_) { |
| +#if defined(GOOGLE_CHROME_BUILD) |
| + // The crash reporter initialization needs IO to complete. |
| + base::ThreadRestrictions::ScopedAllowIO allow_io; |
| + breakpad::InitCrashReporter(std::string()); |
| +#endif |
| + } |
| +} |
| + |
| void WizardController::OnUpdateErrorCheckingForUpdate() { |
| // TODO(nkostylev): Update should be required during OOBE. |
| // We do not want to block users from being able to proceed to the login |