OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_APP_LAUNCH_SIGNIN_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
12 #include "chrome/browser/signin/screenlock_bridge.h" | 11 #include "chrome/browser/signin/screenlock_bridge.h" |
13 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
14 #include "chromeos/login/auth/auth_status_consumer.h" | 13 #include "chromeos/login/auth/auth_status_consumer.h" |
15 #include "chromeos/login/auth/authenticator.h" | 14 #include "chromeos/login/auth/authenticator.h" |
16 #include "components/user_manager/user.h" | 15 #include "components/user_manager/user.h" |
| 16 #include "components/user_manager/user_manager.h" |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
20 class OobeUI; | 20 class OobeUI; |
21 | 21 |
22 // The app launch signin screen shows the user pod of the device owner | 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. | 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 | 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. | 25 // create a new view to superimpose over the desktop. |
26 // | 26 // |
27 // TODO(tengs): This class doesn't quite follow the idiom of the other | 27 // TODO(tengs): This class doesn't quite follow the idiom of the other |
28 // screen classes, as SigninScreenHandler is very tightly coupled with | 28 // screen classes, as SigninScreenHandler is very tightly coupled with |
29 // the login screen. We should do some refactoring in this area. | 29 // the login screen. We should do some refactoring in this area. |
30 class AppLaunchSigninScreen : public SigninScreenHandlerDelegate, | 30 class AppLaunchSigninScreen : public SigninScreenHandlerDelegate, |
31 public AuthStatusConsumer { | 31 public AuthStatusConsumer { |
32 public: | 32 public: |
33 class Delegate { | 33 class Delegate { |
34 public: | 34 public: |
35 virtual void OnOwnerSigninSuccess() = 0; | 35 virtual void OnOwnerSigninSuccess() = 0; |
36 | 36 |
37 protected: | 37 protected: |
38 virtual ~Delegate() {} | 38 virtual ~Delegate() {} |
39 }; | 39 }; |
40 | 40 |
41 AppLaunchSigninScreen(OobeUI* oobe_display, Delegate *delegate); | 41 AppLaunchSigninScreen(OobeUI* oobe_display, Delegate *delegate); |
42 virtual ~AppLaunchSigninScreen(); | 42 virtual ~AppLaunchSigninScreen(); |
43 | 43 |
44 void Show(); | 44 void Show(); |
45 | 45 |
46 static void SetUserManagerForTesting(UserManager* user_manager); | 46 static void SetUserManagerForTesting(user_manager::UserManager* user_manager); |
47 | 47 |
48 private: | 48 private: |
49 void InitOwnerUserList(); | 49 void InitOwnerUserList(); |
50 UserManager* GetUserManager(); | 50 user_manager::UserManager* GetUserManager(); |
51 | 51 |
52 // SigninScreenHandlerDelegate implementation: | 52 // SigninScreenHandlerDelegate implementation: |
53 virtual void CancelPasswordChangedFlow() OVERRIDE; | 53 virtual void CancelPasswordChangedFlow() OVERRIDE; |
54 virtual void CancelUserAdding() OVERRIDE; | 54 virtual void CancelUserAdding() OVERRIDE; |
55 virtual void CreateAccount() OVERRIDE; | 55 virtual void CreateAccount() OVERRIDE; |
56 virtual void CompleteLogin(const UserContext& user_context) OVERRIDE; | 56 virtual void CompleteLogin(const UserContext& user_context) OVERRIDE; |
57 virtual void Login(const UserContext& user_context, | 57 virtual void Login(const UserContext& user_context, |
58 const SigninSpecifics& specifics) OVERRIDE; | 58 const SigninSpecifics& specifics) OVERRIDE; |
59 virtual void MigrateUserData(const std::string& old_password) OVERRIDE; | 59 virtual void MigrateUserData(const std::string& old_password) OVERRIDE; |
60 virtual void LoadWallpaper(const std::string& username) OVERRIDE; | 60 virtual void LoadWallpaper(const std::string& username) OVERRIDE; |
(...skipping 28 matching lines...) Expand all Loading... |
89 virtual void OnAuthSuccess(const UserContext& user_context) OVERRIDE; | 89 virtual void OnAuthSuccess(const UserContext& user_context) OVERRIDE; |
90 | 90 |
91 OobeUI* oobe_ui_; | 91 OobeUI* oobe_ui_; |
92 Delegate* delegate_; | 92 Delegate* delegate_; |
93 LoginDisplayWebUIHandler* webui_handler_; | 93 LoginDisplayWebUIHandler* webui_handler_; |
94 scoped_refptr<Authenticator> authenticator_; | 94 scoped_refptr<Authenticator> authenticator_; |
95 | 95 |
96 // This list should have at most one user, and that user should be the owner. | 96 // This list should have at most one user, and that user should be the owner. |
97 user_manager::UserList owner_user_list_; | 97 user_manager::UserList owner_user_list_; |
98 | 98 |
99 static UserManager* test_user_manager_; | 99 static user_manager::UserManager* test_user_manager_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(AppLaunchSigninScreen); | 101 DISALLOW_COPY_AND_ASSIGN(AppLaunchSigninScreen); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace chromeos | 104 } // namespace chromeos |
105 | 105 |
106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_APP_LAUNCH_SIGNIN_SCREEN_H_ |
OLD | NEW |