| 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 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/browser/chromeos/login/login_utils.h" | 32 #include "chrome/browser/chromeos/login/login_utils.h" |
| 33 #include "chrome/browser/chromeos/login/network_screen.h" | 33 #include "chrome/browser/chromeos/login/network_screen.h" |
| 34 #include "chrome/browser/chromeos/login/oobe_display.h" | 34 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 35 #include "chrome/browser/chromeos/login/registration_screen.h" | 35 #include "chrome/browser/chromeos/login/registration_screen.h" |
| 36 #include "chrome/browser/chromeos/login/reset_screen.h" | 36 #include "chrome/browser/chromeos/login/reset_screen.h" |
| 37 #include "chrome/browser/chromeos/login/update_screen.h" | 37 #include "chrome/browser/chromeos/login/update_screen.h" |
| 38 #include "chrome/browser/chromeos/login/user_image_screen.h" | 38 #include "chrome/browser/chromeos/login/user_image_screen.h" |
| 39 #include "chrome/browser/chromeos/login/user_manager.h" | 39 #include "chrome/browser/chromeos/login/user_manager.h" |
| 40 #include "chrome/browser/chromeos/settings/cros_settings.h" | 40 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 41 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 41 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 42 #include "chrome/browser/google/google_util_chromeos.h" | |
| 43 #include "chrome/browser/prefs/pref_service.h" | 42 #include "chrome/browser/prefs/pref_service.h" |
| 44 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
| 45 #include "chrome/browser/ui/options/options_util.h" | 44 #include "chrome/browser/ui/options/options_util.h" |
| 46 #include "chrome/common/chrome_notification_types.h" | 45 #include "chrome/common/chrome_notification_types.h" |
| 47 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
| 48 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
| 49 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
| 50 #include "content/public/browser/notification_source.h" | 49 #include "content/public/browser/notification_source.h" |
| 51 #include "content/public/browser/notification_types.h" | 50 #include "content/public/browser/notification_types.h" |
| 52 #include "ui/base/accelerators/accelerator.h" | 51 #include "ui/base/accelerators/accelerator.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 #if defined(GOOGLE_CHROME_BUILD) | 140 #if defined(GOOGLE_CHROME_BUILD) |
| 142 is_official_build_(true), | 141 is_official_build_(true), |
| 143 #else | 142 #else |
| 144 is_official_build_(false), | 143 is_official_build_(false), |
| 145 #endif | 144 #endif |
| 146 is_out_of_box_(false), | 145 is_out_of_box_(false), |
| 147 host_(host), | 146 host_(host), |
| 148 oobe_display_(oobe_display), | 147 oobe_display_(oobe_display), |
| 149 usage_statistics_reporting_(true), | 148 usage_statistics_reporting_(true), |
| 150 skip_update_enroll_after_eula_(false), | 149 skip_update_enroll_after_eula_(false), |
| 151 login_screen_started_(false), | 150 login_screen_started_(false) { |
| 152 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | |
| 153 DCHECK(default_controller_ == NULL); | 151 DCHECK(default_controller_ == NULL); |
| 154 default_controller_ = this; | 152 default_controller_ = this; |
| 155 } | 153 } |
| 156 | 154 |
| 157 WizardController::~WizardController() { | 155 WizardController::~WizardController() { |
| 158 if (default_controller_ == this) { | 156 if (default_controller_ == this) { |
| 159 default_controller_ = NULL; | 157 default_controller_ = NULL; |
| 160 } else { | 158 } else { |
| 161 NOTREACHED() << "More than one controller are alive."; | 159 NOTREACHED() << "More than one controller are alive."; |
| 162 } | 160 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 468 |
| 471 CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); | 469 CrosSettings::Get()->SetBoolean(kStatsReportingPref, uma_enabled); |
| 472 if (uma_enabled) { | 470 if (uma_enabled) { |
| 473 #if defined(USE_LINUX_BREAKPAD) | 471 #if defined(USE_LINUX_BREAKPAD) |
| 474 // The crash reporter initialization needs IO to complete. | 472 // The crash reporter initialization needs IO to complete. |
| 475 base::ThreadRestrictions::ScopedAllowIO allow_io; | 473 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 476 InitCrashReporter(); | 474 InitCrashReporter(); |
| 477 #endif | 475 #endif |
| 478 } | 476 } |
| 479 | 477 |
| 480 // TODO(ivankr): post-AU action when |kRLZBrand| is unset. | |
| 481 #if defined(ENABLE_RLZ) | |
| 482 LoadBrandCodeFromFile(); | |
| 483 #else | |
| 484 OnEulaBlockingTasksDone(); | |
| 485 #endif | |
| 486 } | |
| 487 | |
| 488 void WizardController::LoadBrandCodeFromFile() { | |
| 489 google_util::chromeos::SetBrandFromFile( | |
| 490 base::Bind(&WizardController::OnEulaBlockingTasksDone, | |
| 491 weak_ptr_factory_.GetWeakPtr())); | |
| 492 } | |
| 493 | |
| 494 void WizardController::OnEulaBlockingTasksDone() { | |
| 495 if (skip_update_enroll_after_eula_) { | 478 if (skip_update_enroll_after_eula_) { |
| 496 PerformPostEulaActions(); | 479 PerformPostEulaActions(); |
| 497 PerformPostUpdateActions(); | 480 PerformPostUpdateActions(); |
| 498 ShowEnterpriseEnrollmentScreen(); | 481 ShowEnterpriseEnrollmentScreen(); |
| 499 } else { | 482 } else { |
| 500 InitiateOOBEUpdate(); | 483 InitiateOOBEUpdate(); |
| 501 } | 484 } |
| 502 } | 485 } |
| 503 | 486 |
| 504 void WizardController::OnUpdateErrorCheckingForUpdate() { | 487 void WizardController::OnUpdateErrorCheckingForUpdate() { |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 return zero_delay_enabled_; | 835 return zero_delay_enabled_; |
| 853 } | 836 } |
| 854 | 837 |
| 855 // static | 838 // static |
| 856 void WizardController::SetZeroDelays() { | 839 void WizardController::SetZeroDelays() { |
| 857 kShowDelayMs = 0; | 840 kShowDelayMs = 0; |
| 858 zero_delay_enabled_ = true; | 841 zero_delay_enabled_ = true; |
| 859 } | 842 } |
| 860 | 843 |
| 861 } // namespace chromeos | 844 } // namespace chromeos |
| OLD | NEW |