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 121c5e99c9a4fa1d2014b6c29bb799650412c66b..e54417b1c5631dfc33f3b84fe8f0c3cd0f237299 100644 |
--- a/chrome/browser/chromeos/login/wizard_controller.cc |
+++ b/chrome/browser/chromeos/login/wizard_controller.cc |
@@ -584,17 +584,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()); |
stevenjb
2014/09/11 20:31:44
No need for local, just inline this.
gayane -on leave until 09-2017
2014/09/12 17:44:51
Done.
|
+ InitiateMetricsReportingChange(usage_statistics_reporting_, callback_fn); |
if (skip_update_enroll_after_eula_) { |
PerformPostEulaActions(); |
@@ -604,6 +597,17 @@ void WizardController::OnEulaAccepted() { |
} |
} |
+void WizardController::InitiateMetricsReportingChangeCallback(bool enabled) { |
+ CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); |
+ if (enabled) { |
stevenjb
2014/09/11 20:31:44
if() could be in #if, but even better, early exit:
gayane -on leave until 09-2017
2014/09/12 17:44:51
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 |