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 bba472f61c4af8720eb6d88e8a015d4e84ed39fd..88d6fe2a3118a276dd383fba41489f60d4ae8239 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc |
| @@ -644,17 +644,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, |
|
Alexei Svitkine (slow)
2014/08/28 14:46:48
Nit: Indent 2 more.
gayane -on leave until 09-2017
2014/09/03 20:20:08
Done.
|
| + base::Unretained(this)); |
|
Alexei Svitkine (slow)
2014/08/28 14:46:48
Pass a weak ptr via weak_ptr_factory_ instead of b
gayane -on leave until 09-2017
2014/09/03 20:20:08
Done.
|
| + InitiateMetricsReportingChange(callback_fn, usage_statistics_reporting_); |
| if (skip_update_enroll_after_eula_) { |
| PerformPostEulaActions(); |
| @@ -664,6 +657,21 @@ void WizardController::OnEulaAccepted() { |
| } |
| } |
| +void WizardController::InitiateMetricsReportingChangeCallback(bool success) { |
| + if (success) { |
| + CrosSettings::Get()->SetBoolean(kStatsReportingPref, |
| + usage_statistics_reporting_); |
| + if (usage_statistics_reporting_) |
| + { |
|
Alexei Svitkine (slow)
2014/08/28 14:46:48
Nit: Should go on previous line.
gayane -on leave until 09-2017
2014/09/03 20:20:08
Done.
|
| +#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 |