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 f6534bea5b604ebf2fb2270c6d974b578df45f71..26d53b35b5438c9cadcda0edbda74806794613f8 100644 |
| --- a/chrome/browser/chromeos/login/wizard_controller.cc |
| +++ b/chrome/browser/chromeos/login/wizard_controller.cc |
| @@ -39,6 +39,7 @@ |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| #include "chrome/browser/chromeos/settings/cros_settings.h" |
| #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| +#include "chrome/browser/google/google_util_chromeos.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/options/options_util.h" |
| @@ -146,8 +147,10 @@ WizardController::WizardController(chromeos::LoginDisplayHost* host, |
| host_(host), |
| oobe_display_(oobe_display), |
| usage_statistics_reporting_(true), |
| + rlz_enabled_(false), |
| skip_update_enroll_after_eula_(false), |
| - login_screen_started_(false) { |
| + login_screen_started_(false), |
| + ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
| DCHECK(default_controller_ == NULL); |
| default_controller_ = this; |
| } |
| @@ -423,6 +426,10 @@ void WizardController::RegisterPrefs(PrefService* local_state) { |
| local_state->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); |
| local_state->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); |
| local_state->RegisterBooleanPref(prefs::kFactoryResetRequested, false); |
| + local_state->RegisterStringPref(prefs::kRLZBrand, std::string(), |
| + PrefService::UNSYNCABLE_PREF); |
| + local_state->RegisterBooleanPref(prefs::kRLZEnabled, false, |
| + PrefService::UNSYNCABLE_PREF); |
| } |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -461,7 +468,7 @@ void WizardController::OnUpdateCompleted() { |
| void WizardController::OnEulaAccepted() { |
| time_eula_accepted_ = base::Time::Now(); |
| MarkEulaAccepted(); |
| - bool enabled = |
| + bool uma_enabled = |
| OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
| content::NotificationService::current()->Notify( |
| @@ -469,8 +476,8 @@ void WizardController::OnEulaAccepted() { |
| content::NotificationSource(content::Source<WizardController>(this)), |
| content::NotificationService::NoDetails()); |
| - CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); |
| - if (enabled) { |
| + CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); |
| + if (uma_enabled) { |
| #if defined(USE_LINUX_BREAKPAD) |
| // The crash reporter initialization needs IO to complete. |
| base::ThreadRestrictions::ScopedAllowIO allow_io; |
| @@ -478,6 +485,22 @@ void WizardController::OnEulaAccepted() { |
| #endif |
| } |
| + if (rlz_enabled_) { |
| + SaveBoolPreferenceForced(prefs::kRLZEnabled, true); |
| + LoadBrandCodeFromFile(); |
| + } else { |
| + OnEulaBlockingTasksDone(); |
| + } |
| +} |
| + |
| +void WizardController::LoadBrandCodeFromFile() { |
| + google_util::chromeos::SetBrandFromFile( |
| + base::Bind(&WizardController::OnEulaBlockingTasksDone, |
| + weak_ptr_factory_.GetWeakPtr())); |
| +} |
| + |
| +void WizardController::OnEulaBlockingTasksDone() { |
| + LOG(ERROR) << "WizardController::OnEulaBlockingTasksDone"; |
|
Nikita (slow)
2012/11/29 11:17:48
nit: Cleanup logging.
Ivan Korotkov
2012/11/29 17:42:28
Done.
|
| if (skip_update_enroll_after_eula_) { |
| PerformPostEulaActions(); |
| PerformPostUpdateActions(); |
| @@ -833,6 +856,16 @@ bool WizardController::GetUsageStatisticsReporting() const { |
| return usage_statistics_reporting_; |
| } |
| +void WizardController::SetRlzEnabled(bool val) { |
| +#if defined(ENABLE_RLZ) |
| + rlz_enabled_ = val; |
| +#endif |
| +} |
| + |
| +bool WizardController::GetRlzEnabled() const { |
| + return rlz_enabled_; |
| +} |
| + |
| // static |
| bool WizardController::IsZeroDelayEnabled() { |
| return zero_delay_enabled_; |