Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
| 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 22 #include "chrome/browser/chromeos/login/screen_manager.h" | 22 #include "chrome/browser/chromeos/login/screen_manager.h" |
| 23 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 23 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 24 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h" | 24 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h" |
| 25 #include "chrome/browser/chromeos/login/screens/eula_screen.h" | 25 #include "chrome/browser/chromeos/login/screens/eula_screen.h" |
| 26 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h" | 26 #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h" |
| 27 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" | 27 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" |
| 28 #include "chrome/browser/chromeos/login/screens/network_screen.h" | 28 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
| 29 #include "chrome/browser/chromeos/login/screens/reset_screen.h" | 29 #include "chrome/browser/chromeos/login/screens/reset_screen.h" |
| 30 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h" | |
| 30 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 31 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
| 31 | 32 |
| 32 class PrefService; | 33 class PrefService; |
| 33 | 34 |
| 34 namespace pairing_chromeos { | 35 namespace pairing_chromeos { |
| 35 class ControllerPairingController; | 36 class ControllerPairingController; |
| 36 class HostPairingController; | 37 class HostPairingController; |
| 37 class SharkConnectionListener; | 38 class SharkConnectionListener; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace chromeos { | 41 namespace chromeos { |
| 41 | 42 |
| 43 class AutoEnrollmentController; | |
| 42 class ErrorScreen; | 44 class ErrorScreen; |
| 43 struct Geoposition; | 45 struct Geoposition; |
| 44 class LoginDisplayHost; | 46 class LoginDisplayHost; |
| 45 class LoginScreenContext; | 47 class LoginScreenContext; |
| 46 class OobeUI; | 48 class OobeUI; |
| 47 class SimpleGeolocationProvider; | 49 class SimpleGeolocationProvider; |
| 48 class TimeZoneProvider; | 50 class TimeZoneProvider; |
| 49 struct TimeZoneResponseData; | 51 struct TimeZoneResponseData; |
| 50 | 52 |
| 51 // Class that manages control flow between wizard screens. Wizard controller | 53 // Class that manages control flow between wizard screens. Wizard controller |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 void OnSetHostNetworkSuccessful(); | 300 void OnSetHostNetworkSuccessful(); |
| 299 void OnSetHostNetworkFailed(); | 301 void OnSetHostNetworkFailed(); |
| 300 | 302 |
| 301 // Start the enrollment screen using the config from | 303 // Start the enrollment screen using the config from |
| 302 // |prescribed_enrollment_config_|. If |force_interactive| is true, | 304 // |prescribed_enrollment_config_|. If |force_interactive| is true, |
| 303 // the user will be presented with a manual enrollment screen requiring | 305 // the user will be presented with a manual enrollment screen requiring |
| 304 // Gaia credentials. If it is false, the screen may return after trying | 306 // Gaia credentials. If it is false, the screen may return after trying |
| 305 // attestation-based enrollment if appropriate. | 307 // attestation-based enrollment if appropriate. |
| 306 void StartEnrollmentScreen(bool force_interactive); | 308 void StartEnrollmentScreen(bool force_interactive); |
| 307 | 309 |
| 310 // Returns auto enrollment controller (lazily initializes one if it doesn't | |
| 311 // exist already). | |
| 312 AutoEnrollmentController* GetAutoEnrollmentController(); | |
| 313 | |
| 314 std::unique_ptr<AutoEnrollmentController> auto_enrollment_controller_; | |
| 308 std::unique_ptr<ScreenManager> screen_manager_; | 315 std::unique_ptr<ScreenManager> screen_manager_; |
| 309 | 316 |
| 310 // Whether to skip any screens that may normally be shown after login | 317 // Whether to skip any screens that may normally be shown after login |
| 311 // (registration, Terms of Service, user image selection). | 318 // (registration, Terms of Service, user image selection). |
| 312 static bool skip_post_login_screens_; | 319 static bool skip_post_login_screens_; |
| 313 | 320 |
| 314 static bool zero_delay_enabled_; | 321 static bool zero_delay_enabled_; |
| 315 | 322 |
| 316 // Screen that's currently active. | 323 // Screen that's currently active. |
| 317 BaseScreen* current_screen_ = nullptr; | 324 BaseScreen* current_screen_ = nullptr; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 | 379 |
| 373 // Indicates that once image selection screen finishes we should return to | 380 // Indicates that once image selection screen finishes we should return to |
| 374 // a previous screen instead of proceeding with usual flow. | 381 // a previous screen instead of proceeding with usual flow. |
| 375 bool user_image_screen_return_to_previous_hack_ = false; | 382 bool user_image_screen_return_to_previous_hack_ = false; |
| 376 | 383 |
| 377 // Non-owning pointer to local state used for testing. | 384 // Non-owning pointer to local state used for testing. |
| 378 static PrefService* local_state_for_testing_; | 385 static PrefService* local_state_for_testing_; |
| 379 | 386 |
| 380 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestCancel); | 387 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestCancel); |
| 381 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); | 388 FRIEND_TEST_ALL_PREFIXES(WizardControllerFlowTest, Accelerators); |
| 389 FRIEND_TEST_ALL_PREFIXES(WizardControllerDeviceStateTest, | |
| 390 ControlFlowNoForcedReEnrollmentOnFirstBoot); | |
| 391 friend class WizardControllerBrokenLocalStateTest; | |
| 382 friend class WizardControllerFlowTest; | 392 friend class WizardControllerFlowTest; |
| 383 friend class WizardControllerOobeResumeTest; | 393 friend class WizardControllerOobeResumeTest; |
| 384 friend class WizardInProcessBrowserTest; | 394 friend class WizardInProcessBrowserTest; |
| 385 friend class WizardControllerBrokenLocalStateTest; | 395 friend void WaitForAutoEnrollmentState(policy::AutoEnrollmentState); |
|
achuithb
2017/03/24 01:33:29
Are there examples of friend functions like this?
Thiemo Nagel
2017/04/12 14:30:40
I've counted 244 occurrences: https://cs.chromium.
| |
| 386 | 396 |
| 387 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; | 397 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; |
| 388 | 398 |
| 389 std::unique_ptr<SimpleGeolocationProvider> geolocation_provider_; | 399 std::unique_ptr<SimpleGeolocationProvider> geolocation_provider_; |
| 390 std::unique_ptr<TimeZoneProvider> timezone_provider_; | 400 std::unique_ptr<TimeZoneProvider> timezone_provider_; |
| 391 | 401 |
| 392 // Pairing controller for shark devices. | 402 // Pairing controller for shark devices. |
| 393 std::unique_ptr<pairing_chromeos::ControllerPairingController> | 403 std::unique_ptr<pairing_chromeos::ControllerPairingController> |
| 394 shark_controller_; | 404 shark_controller_; |
| 395 | 405 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 412 BaseScreen* hid_screen_ = nullptr; | 422 BaseScreen* hid_screen_ = nullptr; |
| 413 | 423 |
| 414 base::WeakPtrFactory<WizardController> weak_factory_; | 424 base::WeakPtrFactory<WizardController> weak_factory_; |
| 415 | 425 |
| 416 DISALLOW_COPY_AND_ASSIGN(WizardController); | 426 DISALLOW_COPY_AND_ASSIGN(WizardController); |
| 417 }; | 427 }; |
| 418 | 428 |
| 419 } // namespace chromeos | 429 } // namespace chromeos |
| 420 | 430 |
| 421 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ | 431 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_CONTROLLER_H_ |
| OLD | NEW |