| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 14 #include "base/time.h" | 15 #include "base/time.h" |
| 15 #include "base/timer.h" | 16 #include "base/timer.h" |
| 16 #include "chrome/browser/chromeos/login/screen_observer.h" | 17 #include "chrome/browser/chromeos/login/screen_observer.h" |
| 17 #include "chrome/browser/chromeos/login/wizard_screen.h" | 18 #include "chrome/browser/chromeos/login/wizard_screen.h" |
| 18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 19 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
| 20 | 21 |
| 21 class PrefService; | 22 class PrefService; |
| 22 | 23 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void OnUpdateErrorUpdating(); | 185 void OnUpdateErrorUpdating(); |
| 185 void OnUserImageSelected(); | 186 void OnUserImageSelected(); |
| 186 void OnUserImageSkipped(); | 187 void OnUserImageSkipped(); |
| 187 void OnRegistrationSuccess(); | 188 void OnRegistrationSuccess(); |
| 188 void OnRegistrationSkipped(); | 189 void OnRegistrationSkipped(); |
| 189 void OnEnterpriseEnrollmentDone(); | 190 void OnEnterpriseEnrollmentDone(); |
| 190 void OnEnterpriseAutoEnrollmentDone(); | 191 void OnEnterpriseAutoEnrollmentDone(); |
| 191 void OnResetCanceled(); | 192 void OnResetCanceled(); |
| 192 void OnOOBECompleted(); | 193 void OnOOBECompleted(); |
| 193 | 194 |
| 195 // Loads brand code on I/O enabled thread and stores to Local State. |
| 196 void LoadBrandCodeFromFile(); |
| 197 |
| 198 // Called after all post-EULA blocking tasks have been completed. |
| 199 void OnEulaBlockingTasksDone(); |
| 200 |
| 194 // Shows update screen and starts update process. | 201 // Shows update screen and starts update process. |
| 195 void InitiateOOBEUpdate(); | 202 void InitiateOOBEUpdate(); |
| 196 | 203 |
| 197 // Actions that should be done right after EULA is accepted, | 204 // Actions that should be done right after EULA is accepted, |
| 198 // before update check. | 205 // before update check. |
| 199 void PerformPostEulaActions(); | 206 void PerformPostEulaActions(); |
| 200 | 207 |
| 201 // Actions that should be done right after update stage is finished. | 208 // Actions that should be done right after update stage is finished. |
| 202 void PerformPostUpdateActions(); | 209 void PerformPostUpdateActions(); |
| 203 | 210 |
| 204 // Overridden from ScreenObserver: | 211 // Overridden from ScreenObserver: |
| 205 virtual void OnExit(ExitCodes exit_code) OVERRIDE; | 212 virtual void OnExit(ExitCodes exit_code) OVERRIDE; |
| 206 virtual void ShowCurrentScreen() OVERRIDE; | 213 virtual void ShowCurrentScreen() OVERRIDE; |
| 207 virtual void OnSetUserNamePassword(const std::string& username, | 214 virtual void OnSetUserNamePassword(const std::string& username, |
| 208 const std::string& password) OVERRIDE; | 215 const std::string& password) OVERRIDE; |
| 209 virtual void SetUsageStatisticsReporting(bool val) OVERRIDE; | 216 virtual void SetUsageStatisticsReporting(bool val) OVERRIDE; |
| 210 virtual bool GetUsageStatisticsReporting() const OVERRIDE; | 217 virtual bool GetUsageStatisticsReporting() const OVERRIDE; |
| 218 virtual void SetRlzEnabled(bool val) OVERRIDE; |
| 219 virtual bool GetRlzEnabled() const OVERRIDE; |
| 211 | 220 |
| 212 // Switches from one screen to another. | 221 // Switches from one screen to another. |
| 213 void SetCurrentScreen(WizardScreen* screen); | 222 void SetCurrentScreen(WizardScreen* screen); |
| 214 | 223 |
| 215 // Switches from one screen to another with delay before showing. Calling | 224 // Switches from one screen to another with delay before showing. Calling |
| 216 // ShowCurrentScreen directly forces screen to be shown immediately. | 225 // ShowCurrentScreen directly forces screen to be shown immediately. |
| 217 void SetCurrentScreenSmooth(WizardScreen* screen, bool use_smoothing); | 226 void SetCurrentScreenSmooth(WizardScreen* screen, bool use_smoothing); |
| 218 | 227 |
| 219 // Changes status area visibility. | 228 // Changes status area visibility. |
| 220 void SetStatusAreaVisible(bool visible); | 229 void SetStatusAreaVisible(bool visible); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 scoped_ptr<base::DictionaryValue> screen_parameters_; | 274 scoped_ptr<base::DictionaryValue> screen_parameters_; |
| 266 | 275 |
| 267 base::OneShotTimer<WizardController> smooth_show_timer_; | 276 base::OneShotTimer<WizardController> smooth_show_timer_; |
| 268 | 277 |
| 269 OobeDisplay* oobe_display_; | 278 OobeDisplay* oobe_display_; |
| 270 | 279 |
| 271 // State of Usage stat/error reporting checkbox on EULA screen | 280 // State of Usage stat/error reporting checkbox on EULA screen |
| 272 // during wizard lifetime. | 281 // during wizard lifetime. |
| 273 bool usage_statistics_reporting_; | 282 bool usage_statistics_reporting_; |
| 274 | 283 |
| 284 // Whether RLZ tracking is enabled. |
| 285 bool rlz_enabled_; |
| 286 |
| 275 // If true then update check is cancelled and enrollment is started after | 287 // If true then update check is cancelled and enrollment is started after |
| 276 // EULA is accepted. | 288 // EULA is accepted. |
| 277 bool skip_update_enroll_after_eula_; | 289 bool skip_update_enroll_after_eula_; |
| 278 | 290 |
| 279 // Time when the EULA was accepted. Used to measure the duration from the EULA | 291 // Time when the EULA was accepted. Used to measure the duration from the EULA |
| 280 // acceptance until the Sign-In screen is displayed. | 292 // acceptance until the Sign-In screen is displayed. |
| 281 base::Time time_eula_accepted_; | 293 base::Time time_eula_accepted_; |
| 282 | 294 |
| 283 ObserverList<Observer> observer_list_; | 295 ObserverList<Observer> observer_list_; |
| 284 | 296 |
| 285 bool login_screen_started_; | 297 bool login_screen_started_; |
| 286 | 298 |
| 299 base::WeakPtrFactory<WizardController> weak_ptr_factory_; |
| 300 |
| 287 FRIEND_TEST_ALL_PREFIXES(EnterpriseEnrollmentScreenTest, TestCancel); | 301 FRIEND_TEST_ALL_PREFIXES(EnterpriseEnrollmentScreenTest, TestCancel); |
| 288 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); | 302 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); |
| 289 friend class WizardControllerFlowTest; | 303 friend class WizardControllerFlowTest; |
| 290 friend class WizardInProcessBrowserTest; | 304 friend class WizardInProcessBrowserTest; |
| 291 | 305 |
| 292 DISALLOW_COPY_AND_ASSIGN(WizardController); | 306 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 293 }; | 307 }; |
| 294 | 308 |
| 295 } // namespace chromeos | 309 } // namespace chromeos |
| 296 | 310 |
| 297 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 311 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |