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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_OBSERVER_H_
15 // Interface that handles notifications received from any of login wizard
17 class ScreenObserver {
19 // Each login screen or a view shown within login wizard view is itself a
20 // state. Upon exit each view returns one of the results by calling
21 // OnExit() method. Depending on the result and the current view or state
22 // login wizard decides what is the next view to show. There must be an
23 // exit code for each way to exit the screen for each screen.
25 // "Continue" was pressed on network screen and network is online.
27 // Connection failed while trying to load a WebPageScreen.
31 UPDATE_ERROR_CHECKING_FOR_UPDATE,
32 UPDATE_ERROR_UPDATING,
36 ENTERPRISE_ENROLLMENT_COMPLETED,
37 ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED,
39 KIOSK_AUTOLAUNCH_CANCELED,
40 KIOSK_AUTOLAUNCH_CONFIRMED,
41 KIOSK_ENABLE_COMPLETED,
42 TERMS_OF_SERVICE_DECLINED,
43 TERMS_OF_SERVICE_ACCEPTED,
44 WRONG_HWID_WARNING_SKIPPED,
45 EXIT_CODES_COUNT // not a real code, must be the last
48 // Method called by a screen when user's done with it.
49 virtual void OnExit(ExitCodes exit_code) = 0;
51 // Forces current screen showing.
52 virtual void ShowCurrentScreen() = 0;
54 // Notify about new user names and password. It is used to autologin
55 // just created user without asking the same info once again.
56 virtual void OnSetUserNamePassword(const std::string& username,
57 const std::string& password) = 0;
59 // Whether usage statistics reporting is enabled on EULA screen.
60 virtual void SetUsageStatisticsReporting(bool val) = 0;
61 virtual bool GetUsageStatisticsReporting() const = 0;
63 virtual ErrorScreen* GetErrorScreen() = 0;
64 virtual void ShowErrorScreen() = 0;
65 virtual void HideErrorScreen(WizardScreen* parent_screen) = 0;
68 virtual ~ScreenObserver() {}
71 } // namespace chromeos
73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SCREEN_OBSERVER_H_