| 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 REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ | 5 #ifndef REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ |
| 6 #define REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ | 6 #define REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "remoting/host/user_authenticator.h" | 11 #include "remoting/host/user_authenticator.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 // Temporary stub for platforms where this hasn't been implemented yet. | 15 // A fake UserAuthenticator, which accepts all but one user/password pair. |
| 16 | |
| 17 // TODO(lambroslambrou): Implement properly on those platforms, then | |
| 18 // delete this stub when it's no longer needed. | |
| 19 class UserAuthenticatorFake : public UserAuthenticator { | 16 class UserAuthenticatorFake : public UserAuthenticator { |
| 20 public: | 17 public: |
| 21 UserAuthenticatorFake(); | 18 UserAuthenticatorFake(); |
| 22 virtual ~UserAuthenticatorFake(); | 19 virtual ~UserAuthenticatorFake(); |
| 23 | 20 |
| 24 virtual bool Authenticate(const std::string& username, | 21 virtual bool Authenticate(const std::string& username, |
| 25 const std::string& password); | 22 const std::string& password); |
| 26 | 23 |
| 24 // Get the user/password pair that a UserAuthenticatorFake rejects. |
| 25 static const char* fail_username(); |
| 26 static const char* fail_password(); |
| 27 |
| 27 private: | 28 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(UserAuthenticatorFake); | 29 DISALLOW_COPY_AND_ASSIGN(UserAuthenticatorFake); |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 } // namespace remoting | 32 } // namespace remoting |
| 32 | 33 |
| 33 #endif // REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ | 34 #endif // REMOTING_HOST_USER_AUTHENTICATOR_FAKE_H_ |
| OLD | NEW |