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