| 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/chromeos/login/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 previous_screen_(NULL), | 140 previous_screen_(NULL), |
| 141 #if defined(GOOGLE_CHROME_BUILD) | 141 #if defined(GOOGLE_CHROME_BUILD) |
| 142 is_official_build_(true), | 142 is_official_build_(true), |
| 143 #else | 143 #else |
| 144 is_official_build_(false), | 144 is_official_build_(false), |
| 145 #endif | 145 #endif |
| 146 is_out_of_box_(false), | 146 is_out_of_box_(false), |
| 147 host_(host), | 147 host_(host), |
| 148 oobe_display_(oobe_display), | 148 oobe_display_(oobe_display), |
| 149 usage_statistics_reporting_(true), | 149 usage_statistics_reporting_(true), |
| 150 rlz_enabled_(false), | |
| 151 skip_update_enroll_after_eula_(false), | 150 skip_update_enroll_after_eula_(false), |
| 152 login_screen_started_(false), | 151 login_screen_started_(false), |
| 153 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 152 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
| 154 DCHECK(default_controller_ == NULL); | 153 DCHECK(default_controller_ == NULL); |
| 155 default_controller_ = this; | 154 default_controller_ = this; |
| 156 } | 155 } |
| 157 | 156 |
| 158 WizardController::~WizardController() { | 157 WizardController::~WizardController() { |
| 159 if (default_controller_ == this) { | 158 if (default_controller_ == this) { |
| 160 default_controller_ = NULL; | 159 default_controller_ = NULL; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (local_state->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) { | 415 if (local_state->FindPreference(prefs::kVirtualKeyboardEnabled) == NULL) { |
| 417 local_state->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, | 416 local_state->RegisterBooleanPref(prefs::kVirtualKeyboardEnabled, |
| 418 false, | 417 false, |
| 419 PrefService::UNSYNCABLE_PREF); | 418 PrefService::UNSYNCABLE_PREF); |
| 420 } | 419 } |
| 421 local_state->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); | 420 local_state->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); |
| 422 local_state->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); | 421 local_state->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); |
| 423 local_state->RegisterBooleanPref(prefs::kFactoryResetRequested, false); | 422 local_state->RegisterBooleanPref(prefs::kFactoryResetRequested, false); |
| 424 local_state->RegisterStringPref(prefs::kRLZBrand, std::string(), | 423 local_state->RegisterStringPref(prefs::kRLZBrand, std::string(), |
| 425 PrefService::UNSYNCABLE_PREF); | 424 PrefService::UNSYNCABLE_PREF); |
| 426 local_state->RegisterBooleanPref(prefs::kRLZEnabled, false, | |
| 427 PrefService::UNSYNCABLE_PREF); | |
| 428 } | 425 } |
| 429 | 426 |
| 430 /////////////////////////////////////////////////////////////////////////////// | 427 /////////////////////////////////////////////////////////////////////////////// |
| 431 // WizardController, ExitHandlers: | 428 // WizardController, ExitHandlers: |
| 432 void WizardController::OnNetworkConnected() { | 429 void WizardController::OnNetworkConnected() { |
| 433 if (is_official_build_) { | 430 if (is_official_build_) { |
| 434 if (!IsEulaAccepted()) { | 431 if (!IsEulaAccepted()) { |
| 435 ShowEulaScreen(); | 432 ShowEulaScreen(); |
| 436 } else { | 433 } else { |
| 437 // Possible cases: | 434 // Possible cases: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 470 |
| 474 CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); | 471 CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); |
| 475 if (uma_enabled) { | 472 if (uma_enabled) { |
| 476 #if defined(USE_LINUX_BREAKPAD) | 473 #if defined(USE_LINUX_BREAKPAD) |
| 477 // The crash reporter initialization needs IO to complete. | 474 // The crash reporter initialization needs IO to complete. |
| 478 base::ThreadRestrictions::ScopedAllowIO allow_io; | 475 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 479 InitCrashReporter(); | 476 InitCrashReporter(); |
| 480 #endif | 477 #endif |
| 481 } | 478 } |
| 482 | 479 |
| 483 // TODO(ivankr): post-AU action when |kRLZEnabled| is unset. | 480 // TODO(ivankr): post-AU action when |kRLZBrand| is unset. |
| 484 #if defined(ENABLE_RLZ) | 481 #if defined(ENABLE_RLZ) |
| 485 SaveBoolPreferenceForced(prefs::kRLZEnabled, rlz_enabled_); | 482 LoadBrandCodeFromFile(); |
| 483 #else |
| 484 OnEulaBlockingTasksDone(); |
| 486 #endif | 485 #endif |
| 487 if (rlz_enabled_) | |
| 488 LoadBrandCodeFromFile(); | |
| 489 else | |
| 490 OnEulaBlockingTasksDone(); | |
| 491 } | 486 } |
| 492 | 487 |
| 493 void WizardController::LoadBrandCodeFromFile() { | 488 void WizardController::LoadBrandCodeFromFile() { |
| 494 google_util::chromeos::SetBrandFromFile( | 489 google_util::chromeos::SetBrandFromFile( |
| 495 base::Bind(&WizardController::OnEulaBlockingTasksDone, | 490 base::Bind(&WizardController::OnEulaBlockingTasksDone, |
| 496 weak_ptr_factory_.GetWeakPtr())); | 491 weak_ptr_factory_.GetWeakPtr())); |
| 497 } | 492 } |
| 498 | 493 |
| 499 void WizardController::OnEulaBlockingTasksDone() { | 494 void WizardController::OnEulaBlockingTasksDone() { |
| 500 if (skip_update_enroll_after_eula_) { | 495 if (skip_update_enroll_after_eula_) { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 } | 840 } |
| 846 | 841 |
| 847 void WizardController::SetUsageStatisticsReporting(bool val) { | 842 void WizardController::SetUsageStatisticsReporting(bool val) { |
| 848 usage_statistics_reporting_ = val; | 843 usage_statistics_reporting_ = val; |
| 849 } | 844 } |
| 850 | 845 |
| 851 bool WizardController::GetUsageStatisticsReporting() const { | 846 bool WizardController::GetUsageStatisticsReporting() const { |
| 852 return usage_statistics_reporting_; | 847 return usage_statistics_reporting_; |
| 853 } | 848 } |
| 854 | 849 |
| 855 void WizardController::SetRlzEnabled(bool val) { | |
| 856 #if defined(ENABLE_RLZ) | |
| 857 rlz_enabled_ = val; | |
| 858 #endif | |
| 859 } | |
| 860 | |
| 861 bool WizardController::GetRlzEnabled() const { | |
| 862 return rlz_enabled_; | |
| 863 } | |
| 864 | |
| 865 // static | 850 // static |
| 866 bool WizardController::IsZeroDelayEnabled() { | 851 bool WizardController::IsZeroDelayEnabled() { |
| 867 return zero_delay_enabled_; | 852 return zero_delay_enabled_; |
| 868 } | 853 } |
| 869 | 854 |
| 870 // static | 855 // static |
| 871 void WizardController::SetZeroDelays() { | 856 void WizardController::SetZeroDelays() { |
| 872 kShowDelayMs = 0; | 857 kShowDelayMs = 0; |
| 873 zero_delay_enabled_ = true; | 858 zero_delay_enabled_ = true; |
| 874 } | 859 } |
| 875 | 860 |
| 876 } // namespace chromeos | 861 } // namespace chromeos |
| OLD | NEW |