| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_LOGIN_PERFORMER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // CAPTCHA dialog, password input. | 44 // CAPTCHA dialog, password input. |
| 45 // If |delegate_| is NULL that does mean that LoginPerformer instance | 45 // If |delegate_| is NULL that does mean that LoginPerformer instance |
| 46 // is waiting for successful online login or blocked on online login failure. | 46 // is waiting for successful online login or blocked on online login failure. |
| 47 // In case of failure password/captcha | 47 // In case of failure password/captcha |
| 48 // input & error messages display is dedicated to ScreenLocker instance. | 48 // input & error messages display is dedicated to ScreenLocker instance. |
| 49 // | 49 // |
| 50 // 2 things make LoginPerfrormer instance exist longer: | 50 // 2 things make LoginPerfrormer instance exist longer: |
| 51 // 1. ScreenLock active (pending correct new password input) | 51 // 1. ScreenLock active (pending correct new password input) |
| 52 // 2. Pending online auth request. | 52 // 2. Pending online auth request. |
| 53 class LoginPerformer : public LoginStatusConsumer, | 53 class LoginPerformer : public LoginStatusConsumer, |
| 54 public content::NotificationObserver, | 54 public content::NotificationObserver { |
| 55 public ProfileManagerObserver { | |
| 56 public: | 55 public: |
| 57 // Delegate class to get notifications from the LoginPerformer. | 56 // Delegate class to get notifications from the LoginPerformer. |
| 58 class Delegate : public LoginStatusConsumer { | 57 class Delegate : public LoginStatusConsumer { |
| 59 public: | 58 public: |
| 60 virtual ~Delegate() {} | 59 virtual ~Delegate() {} |
| 61 virtual void WhiteListCheckFailed(const std::string& email) = 0; | 60 virtual void WhiteListCheckFailed(const std::string& email) = 0; |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 explicit LoginPerformer(Delegate* delegate); | 63 explicit LoginPerformer(Delegate* delegate); |
| 65 virtual ~LoginPerformer(); | 64 virtual ~LoginPerformer(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 AUTH_MODE_EXTENSION | 118 AUTH_MODE_EXTENSION |
| 120 } AuthorizationMode; | 119 } AuthorizationMode; |
| 121 AuthorizationMode auth_mode() const { return auth_mode_; } | 120 AuthorizationMode auth_mode() const { return auth_mode_; } |
| 122 | 121 |
| 123 private: | 122 private: |
| 124 // content::NotificationObserver implementation: | 123 // content::NotificationObserver implementation: |
| 125 virtual void Observe(int type, | 124 virtual void Observe(int type, |
| 126 const content::NotificationSource& source, | 125 const content::NotificationSource& source, |
| 127 const content::NotificationDetails& details) OVERRIDE; | 126 const content::NotificationDetails& details) OVERRIDE; |
| 128 | 127 |
| 129 // ProfileManagerObserver implementation: | 128 // Callback for asynchronous profile creation. |
| 130 virtual void OnProfileCreated(Profile* profile, Status status) OVERRIDE; | 129 void OnProfileCreated(Profile* profile, |
| 130 Profile::CreateStatus status); |
| 131 | 131 |
| 132 // Requests screen lock and subscribes to screen lock notifications. | 132 // Requests screen lock and subscribes to screen lock notifications. |
| 133 void RequestScreenLock(); | 133 void RequestScreenLock(); |
| 134 | 134 |
| 135 // Requests screen unlock. | 135 // Requests screen unlock. |
| 136 void RequestScreenUnlock(); | 136 void RequestScreenUnlock(); |
| 137 | 137 |
| 138 // Resolves initial LoginFailure::NETWORK_AUTH_FAILED error i.e. | 138 // Resolves initial LoginFailure::NETWORK_AUTH_FAILED error i.e. |
| 139 // when screen is not locked yet. | 139 // when screen is not locked yet. |
| 140 void ResolveInitialNetworkAuthFailure(); | 140 void ResolveInitialNetworkAuthFailure(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 bool using_oauth_; | 207 bool using_oauth_; |
| 208 | 208 |
| 209 base::WeakPtrFactory<LoginPerformer> weak_factory_; | 209 base::WeakPtrFactory<LoginPerformer> weak_factory_; |
| 210 | 210 |
| 211 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); | 211 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 } // namespace chromeos | 214 } // namespace chromeos |
| 215 | 215 |
| 216 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ | 216 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ |
| OLD | NEW |