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

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: 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
Nikita (slow) 2014/06/06 14:49:47 Are you planning to leave this (LoginDisplay) inte
Denis Kuznetsov (DE-MUC) 2014/06/06 15:18:42 It will live in some way, but it's most likely to
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 // Sign in as a retail mode user.
Nikita (slow) 2014/06/06 14:49:48 nit: Remove commented code.
Denis Kuznetsov (DE-MUC) 2014/06/06 15:18:42 Done.
56 // virtual void LoginAsRetailModeUser() = 0;
57
58 // Sign in into guest session.
59 // virtual void LoginAsGuest() = 0;
60
61 // Sign in into the public account identified by |username|.
62 // virtual void LoginAsPublicAccount(const std::string& username) = 0;
63
64 // Login to kiosk mode for app with |app_id|.
65 virtual void LoginAsKioskApp(const std::string& app_id,
66 bool diagnostic_mode) = 0;
67
68 // Returns true if sign in is in progress.
69 virtual bool IsSigninInProgress() const = 0;
70
71 // Sign out the currently signed in user.
72 // Used when the lock screen is being displayed.
73 virtual void Signout() = 0;
74
41 // Create new Google account. 75 // Create new Google account.
42 virtual void CreateAccount() = 0; 76 virtual void CreateAccount() = 0;
43 77
44 // Complete sign process with specified |user_context|. 78 // Complete sign process with specified |user_context|.
45 // Used for new users authenticated through an extension. 79 // Used for new users authenticated through an extension.
46 virtual void CompleteLogin(const UserContext& user_context) = 0; 80 virtual void CompleteLogin(const UserContext& user_context) = 0;
47 81
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. 82 // Notify the delegate when the sign-in UI is finished loading.
76 virtual void OnSigninScreenReady() = 0; 83 virtual void OnSigninScreenReady() = 0;
77
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. 84 // Called when the user requests enterprise enrollment.
82 virtual void OnStartEnterpriseEnrollment() = 0; 85 virtual void OnStartEnterpriseEnrollment() = 0;
83 86
84 // Called when the user requests kiosk enable screen. 87 // Called when the user requests kiosk enable screen.
85 virtual void OnStartKioskEnableScreen() = 0; 88 virtual void OnStartKioskEnableScreen() = 0;
86 89
87 // Called when the owner permission for kiosk app auto launch is requested. 90 // Called when the owner permission for kiosk app auto launch is requested.
88 virtual void OnStartKioskAutolaunchScreen() = 0; 91 virtual void OnStartKioskAutolaunchScreen() = 0;
89 92
90 // Shows wrong HWID screen. 93 // Shows wrong HWID screen.
91 virtual void ShowWrongHWIDScreen() = 0; 94 virtual void ShowWrongHWIDScreen() = 0;
92 95
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|. 96 // 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|. 97 // If it succeeds, user's displayed email value will be updated to |email|.
102 virtual void SetDisplayEmail(const std::string& email) = 0; 98 virtual void SetDisplayEmail(const std::string& email) = 0;
103 99
104 // Sign out the currently signed in user. 100 // Returns name of the currently connected network, for error message,
105 // Used when the lock screen is being displayed. 101 virtual base::string16 GetConnectedNetworkName() = 0;
106 virtual void Signout() = 0; 102
103 // Called when existing user pod is selected in the UI.
104 virtual void OnUserSelected(
105 const std::string& username) = 0; // Not called!
106
107 // Restarts the public-session auto-login timer if it is running.
108 virtual void ResetPublicSessionAutoLoginTimer() = 0; //---
107 109
108 protected: 110 protected:
109 virtual ~Delegate(); 111 virtual ~Delegate();
110 }; 112 };
111 113
112 // |background_bounds| determines the bounds of login UI background. 114 // |background_bounds| determines the bounds of login UI background.
113 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds); 115 LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds);
114 virtual ~LoginDisplay(); 116 virtual ~LoginDisplay();
115 117
116 // Clears and enables fields on user pod or GAIA frame. 118 // 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. 187 // in redesigned login stack.
186 // Login stack (and this object) will be recreated for next user sign in. 188 // Login stack (and this object) will be recreated for next user sign in.
187 bool is_signin_completed_; 189 bool is_signin_completed_;
188 190
189 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); 191 DISALLOW_COPY_AND_ASSIGN(LoginDisplay);
190 }; 192 };
191 193
192 } // namespace chromeos 194 } // namespace chromeos
193 195
194 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ 196 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698