1 // Copyright 2013 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_APP_LAUNCH_SIGNIN_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/signin/screenlock_bridge.h"
12 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
13 #include "chromeos/login/auth/auth_status_consumer.h"
14 #include "chromeos/login/auth/authenticator.h"
15 #include "components/user_manager/user.h"
16 #include "components/user_manager/user_manager.h"
22 // The app launch signin screen shows the user pod of the device owner
23 // and requires the user to login in order to access the network dialog.
24 // This screen is quite similar to the standard lock screen, but we do not
25 // create a new view to superimpose over the desktop.
27 // TODO(tengs): This class doesn't quite follow the idiom of the other
28 // screen classes, as SigninScreenHandler is very tightly coupled with
29 // the login screen. We should do some refactoring in this area.
30 class AppLaunchSigninScreen : public SigninScreenHandlerDelegate,
31 public AuthStatusConsumer {
35 virtual void OnOwnerSigninSuccess() = 0;
38 virtual ~Delegate() {}
41 AppLaunchSigninScreen(OobeUI* oobe_display, Delegate *delegate);
42 virtual ~AppLaunchSigninScreen();
46 static void SetUserManagerForTesting(user_manager::UserManager* user_manager);
49 void InitOwnerUserList();
50 user_manager::UserManager* GetUserManager();
52 // SigninScreenHandlerDelegate implementation:
53 virtual void CancelPasswordChangedFlow() override;
54 virtual void CancelUserAdding() override;
55 virtual void CreateAccount() override;
56 virtual void CompleteLogin(const UserContext& user_context) override;
57 virtual void Login(const UserContext& user_context,
58 const SigninSpecifics& specifics) override;
59 virtual void MigrateUserData(const std::string& old_password) override;
60 virtual void LoadWallpaper(const std::string& username) override;
61 virtual void LoadSigninWallpaper() override;
62 virtual void OnSigninScreenReady() override;
63 virtual void RemoveUser(const std::string& username) override;
64 virtual void ResyncUserData() override;
65 virtual void ShowEnterpriseEnrollmentScreen() override;
66 virtual void ShowKioskEnableScreen() override;
67 virtual void ShowKioskAutolaunchScreen() override;
68 virtual void ShowWrongHWIDScreen() override;
69 virtual void SetWebUIHandler(
70 LoginDisplayWebUIHandler* webui_handler) override;
71 virtual void ShowSigninScreenForCreds(const std::string& username,
72 const std::string& password);
73 virtual const user_manager::UserList& GetUsers() const override;
74 virtual bool IsShowGuest() const override;
75 virtual bool IsShowUsers() const override;
76 virtual bool IsSigninInProgress() const override;
77 virtual bool IsUserSigninCompleted() const override;
78 virtual void SetDisplayEmail(const std::string& email) override;
79 virtual void Signout() override;
80 virtual void HandleGetUsers() override;
81 virtual void SetAuthType(
82 const std::string& username,
83 ScreenlockBridge::LockHandler::AuthType auth_type) override;
84 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType(
85 const std::string& username) const override;
87 // AuthStatusConsumer implementation:
88 virtual void OnAuthFailure(const AuthFailure& error) override;
89 virtual void OnAuthSuccess(const UserContext& user_context) override;
93 LoginDisplayWebUIHandler* webui_handler_;
94 scoped_refptr<Authenticator> authenticator_;
96 // This list should have at most one user, and that user should be the owner.
97 user_manager::UserList owner_user_list_;
99 static user_manager::UserManager* test_user_manager_;
101 DISALLOW_COPY_AND_ASSIGN(AppLaunchSigninScreen);
104 } // namespace chromeos
106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_