| 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_SCREEN_LOCKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // instance of itself which will be deleted when the system is unlocked. | 32 // instance of itself which will be deleted when the system is unlocked. |
| 33 class ScreenLocker : public LoginStatusConsumer { | 33 class ScreenLocker : public LoginStatusConsumer { |
| 34 public: | 34 public: |
| 35 explicit ScreenLocker(const User& user); | 35 explicit ScreenLocker(const User& user); |
| 36 | 36 |
| 37 // Returns the default instance if it has been created. | 37 // Returns the default instance if it has been created. |
| 38 static ScreenLocker* default_screen_locker() { | 38 static ScreenLocker* default_screen_locker() { |
| 39 return screen_locker_; | 39 return screen_locker_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool locked() const { return locked_; } |
| 43 |
| 42 // Initialize and show the screen locker. | 44 // Initialize and show the screen locker. |
| 43 void Init(); | 45 void Init(); |
| 44 | 46 |
| 45 // LoginStatusConsumer implements: | 47 // LoginStatusConsumer implements: |
| 46 virtual void OnLoginFailure(const chromeos::LoginFailure& error) OVERRIDE; | 48 virtual void OnLoginFailure(const chromeos::LoginFailure& error) OVERRIDE; |
| 47 virtual void OnLoginSuccess(const std::string& username, | 49 virtual void OnLoginSuccess(const std::string& username, |
| 48 const std::string& password, | 50 const std::string& password, |
| 49 const GaiaAuthConsumer::ClientLoginResult& result, | 51 const GaiaAuthConsumer::ClientLoginResult& result, |
| 50 bool pending_requests, | 52 bool pending_requests, |
| 51 bool using_oauth) OVERRIDE; | 53 bool using_oauth) OVERRIDE; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Delegate to forward all login status events to. | 146 // Delegate to forward all login status events to. |
| 145 // Tests can use this to receive login status events. | 147 // Tests can use this to receive login status events. |
| 146 LoginStatusConsumer* login_status_consumer_; | 148 LoginStatusConsumer* login_status_consumer_; |
| 147 | 149 |
| 148 DISALLOW_COPY_AND_ASSIGN(ScreenLocker); | 150 DISALLOW_COPY_AND_ASSIGN(ScreenLocker); |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace chromeos | 153 } // namespace chromeos |
| 152 | 154 |
| 153 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_H_ | 155 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_H_ |
| OLD | NEW |