| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 #include "chromeos/dbus/auth_policy_client.h" | 12 #include "chromeos/dbus/auth_policy_client.h" |
| 13 | 13 |
| 14 class AccountId; | 14 class AccountId; |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 class CHROMEOS_EXPORT FakeAuthPolicyClient : public AuthPolicyClient { | 18 class CHROMEOS_EXPORT FakeAuthPolicyClient : public AuthPolicyClient { |
| 19 public: | 19 public: |
| 20 FakeAuthPolicyClient(); | 20 FakeAuthPolicyClient(); |
| 21 ~FakeAuthPolicyClient() override; | 21 ~FakeAuthPolicyClient() override; |
| 22 | 22 |
| 23 // DBusClient overrides. | 23 // DBusClient overrides. |
| 24 void Init(dbus::Bus* bus) override; | 24 void Init(dbus::Bus* bus) override; |
| 25 // AuthPolicyClient overrides. | 25 // AuthPolicyClient overrides. |
| 26 void JoinAdDomain(const std::string& machine_name, | 26 void JoinAdDomain(const std::string& machine_name, |
| 27 const std::string& user_principal_name, | 27 const std::string& user_principal_name, |
| 28 int password_fd, | 28 int password_fd, |
| 29 const JoinCallback& callback) override; | 29 JoinCallback callback) override; |
| 30 void AuthenticateUser(const std::string& user_principal_name, | 30 void AuthenticateUser(const std::string& user_principal_name, |
| 31 int password_fd, | 31 int password_fd, |
| 32 const AuthCallback& callback) override; | 32 AuthCallback callback) override; |
| 33 void RefreshDevicePolicy(const RefreshPolicyCallback& calllback) override; | 33 void RefreshDevicePolicy(RefreshPolicyCallback calllback) override; |
| 34 void RefreshUserPolicy(const AccountId& account_id, | 34 void RefreshUserPolicy(const AccountId& account_id, |
| 35 const RefreshPolicyCallback& callback) override; | 35 RefreshPolicyCallback callback) override; |
| 36 | 36 |
| 37 // Mark service as started. It's getting started by the | 37 // Mark service as started. It's getting started by the |
| 38 // UpstartClient::StartAuthPolicyService on the Active Directory managed | 38 // UpstartClient::StartAuthPolicyService on the Active Directory managed |
| 39 // devices. | 39 // devices. |
| 40 void set_started(bool started) { started_ = started; } | 40 void set_started(bool started) { started_ = started; } |
| 41 | 41 |
| 42 bool started() const { return started_; } |
| 43 |
| 42 void set_auth_error(authpolicy::ErrorType auth_error) { | 44 void set_auth_error(authpolicy::ErrorType auth_error) { |
| 43 auth_error_ = auth_error; | 45 auth_error_ = auth_error; |
| 44 } | 46 } |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 bool started_ = false; | 49 bool started_ = false; |
| 48 authpolicy::ErrorType auth_error_ = authpolicy::ERROR_NONE; | 50 authpolicy::ErrorType auth_error_ = authpolicy::ERROR_NONE; |
| 49 DISALLOW_COPY_AND_ASSIGN(FakeAuthPolicyClient); | 51 DISALLOW_COPY_AND_ASSIGN(FakeAuthPolicyClient); |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 } // namespace chromeos | 54 } // namespace chromeos |
| 53 | 55 |
| 54 #endif // CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ | 56 #endif // CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ |
| OLD | NEW |