Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display.h

Issue 324463003: ChromeOS login webui refactoring : Simplify login methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with ToT Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_UI_LOGIN_DISPLAY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "chrome/browser/chromeos/login/help_app_launcher.h" 13 #include "chrome/browser/chromeos/login/help_app_launcher.h"
14 #include "chrome/browser/chromeos/login/signin_specifics.h"
14 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h" 15 #include "chrome/browser/chromeos/login/users/remove_user_delegate.h"
15 #include "chrome/browser/chromeos/login/users/user.h" 16 #include "chrome/browser/chromeos/login/users/user.h"
16 #include "chrome/browser/chromeos/login/users/user_manager.h" 17 #include "chrome/browser/chromeos/login/users/user_manager.h"
17 #include "ui/gfx/image/image.h" 18 #include "ui/gfx/image/image.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
20 21
21 namespace chromeos { 22 namespace chromeos {
22 23
23 class UserContext; 24 class UserContext;
24 25
25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. 26 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class.
26 // An abstract class that defines login UI implementation. 27 // An abstract class that defines login UI implementation.
27 class LoginDisplay : public RemoveUserDelegate { 28 class LoginDisplay : public RemoveUserDelegate {
28 public: 29 public:
29 // Sign in error IDs that require detailed error screen and not just 30 // Sign in error IDs that require detailed error screen and not just
30 // a simple error bubble. 31 // a simple error bubble.
31 enum SigninError { 32 enum SigninError {
32 // Shown in case of critical TPM error. 33 // Shown in case of critical TPM error.
33 TPM_ERROR, 34 TPM_ERROR,
34 }; 35 };
35 36
36 class Delegate { 37 class Delegate {
37 public: 38 public:
38 // Cancels current password changed flow. 39 // Cancels current password changed flow.
39 virtual void CancelPasswordChangedFlow() = 0; 40 virtual void CancelPasswordChangedFlow() = 0;
40 41
42 // Ignore password change, remove existing cryptohome and
43 // force full sync of user data.
44 virtual void ResyncUserData() = 0;
45
46 // Decrypt cryptohome using user provided |old_password|
47 // and migrate to new password.
48 virtual void MigrateUserData(const std::string& old_password) = 0;
49
50 // Sign in using |username| and |password| specified.
51 // Used for known users only.
52 virtual void Login(const UserContext& user_context,
53 const SigninSpecifics& specifics) = 0;
54
55 // Returns true if sign in is in progress.
56 virtual bool IsSigninInProgress() const = 0;
57
58 // Sign out the currently signed in user.
59 // Used when the lock screen is being displayed.
60 virtual void Signout() = 0;
61
41 // Create new Google account. 62 // Create new Google account.
42 virtual void CreateAccount() = 0; 63 virtual void CreateAccount() = 0;
43 64
44 // Complete sign process with specified |user_context|. 65 // Complete sign process with specified |user_context|.
45 // Used for new users authenticated through an extension. 66 // Used for new users authenticated through an extension.
46 virtual void CompleteLogin(const UserContext& user_context) = 0; 67 virtual void CompleteLogin(const UserContext& user_context) = 0;
47 68
48 // Returns name of the currently connected network.
49 virtual base::string16 GetConnectedNetworkName() = 0;
50
51 // Returns true if sign in is in progress.
52 virtual bool IsSigninInProgress() const = 0;
53
54 // Sign in using |username| and |password| specified.
55 // Used for known users only.
56 virtual void Login(const UserContext& user_context) = 0;
57
58 // Sign in as a retail mode user.
59 virtual void LoginAsRetailModeUser() = 0;
60
61 // Sign in into guest session.
62 virtual void LoginAsGuest() = 0;
63
64 // Decrypt cryptohome using user provided |old_password|
65 // and migrate to new password.
66 virtual void MigrateUserData(const std::string& old_password) = 0;
67
68 // Sign in into the public account identified by |username|.
69 virtual void LoginAsPublicAccount(const std::string& username) = 0;
70
71 // Login to kiosk mode for app with |app_id|.
72 virtual void LoginAsKioskApp(const std::string& app_id,
73 bool diagnostic_mode) = 0;
74
75 // Notify the delegate when the sign-in UI is finished loading. 69 // Notify the delegate when the sign-in UI is finished loading.
76 virtual void OnSigninScreenReady() = 0; 70 virtual void OnSigninScreenReady() = 0;
77 71
78 // Called when existing user pod is selected in the UI.
79 virtual void OnUserSelected(const std::string& username) = 0;
80
81 // Called when the user requests enterprise enrollment. 72 // Called when the user requests enterprise enrollment.
82 virtual void OnStartEnterpriseEnrollment() = 0; 73 virtual void OnStartEnterpriseEnrollment() = 0;
83 74
84 // Called when the user requests kiosk enable screen. 75 // Called when the user requests kiosk enable screen.
85 virtual void OnStartKioskEnableScreen() = 0; 76 virtual void OnStartKioskEnableScreen() = 0;
86 77
87 // Called when the owner permission for kiosk app auto launch is requested. 78 // Called when the owner permission for kiosk app auto launch is requested.
88 virtual void OnStartKioskAutolaunchScreen() = 0; 79 virtual void OnStartKioskAutolaunchScreen() = 0;
89 80
90 // Shows wrong HWID screen. 81 // Shows wrong HWID screen.
91 virtual void ShowWrongHWIDScreen() = 0; 82 virtual void ShowWrongHWIDScreen() = 0;
92 83
93 // Restarts the public-session auto-login timer if it is running.
94 virtual void ResetPublicSessionAutoLoginTimer() = 0;
95
96 // Ignore password change, remove existing cryptohome and
97 // force full sync of user data.
98 virtual void ResyncUserData() = 0;
99
100 // Sets the displayed email for the next login attempt with |CompleteLogin|. 84 // Sets the displayed email for the next login attempt with |CompleteLogin|.
101 // If it succeeds, user's displayed email value will be updated to |email|. 85 // If it succeeds, user's displayed email value will be updated to |email|.
102 virtual void SetDisplayEmail(const std::string& email) = 0; 86 virtual void SetDisplayEmail(const std::string& email) = 0;
103 87
104 // Sign out the currently signed in user. 88 // Returns name of the currently connected network, for error message,
105 // Used when the lock screen is being displayed. 89 virtual base::string16 GetConnectedNetworkName() = 0;
106 virtual void Signout() = 0; 90
91 // Restarts the public-session auto-login timer if it is running.
92 virtual void ResetPublicSessionAutoLoginTimer() = 0;
107 93
108 protected: 94 protected:
109 virtual ~Delegate(); 95 virtual ~Delegate();
110 }; 96 };
111 97
112 // |background_bounds| determines the bounds of login UI background. 98 // |background_bounds| determines the bounds of login UI background.
113 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds); 99 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds);
114 virtual ~LoginDisplay(); 100 virtual ~LoginDisplay();
115 101
116 // Clears and enables fields on user pod or GAIA frame. 102 // Clears and enables fields on user pod or GAIA frame.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // in redesigned login stack. 171 // in redesigned login stack.
186 // Login stack (and this object) will be recreated for next user sign in. 172 // Login stack (and this object) will be recreated for next user sign in.
187 bool is_signin_completed_; 173 bool is_signin_completed_;
188 174
189 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); 175 DISALLOW_COPY_AND_ASSIGN(LoginDisplay);
190 }; 176 };
191 177
192 } // namespace chromeos 178 } // namespace chromeos
193 179
194 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ 180 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signin_specifics.cc ('k') | chrome/browser/chromeos/login/ui/webui_login_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698