| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/memory/weak_ptr.h" |
| 11 | 12 |
| 12 #include "chromeos/dbus/auth_policy_client.h" | 13 #include "chromeos/dbus/auth_policy_client.h" |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 | 16 |
| 16 class CHROMEOS_EXPORT FakeAuthPolicyClient : public AuthPolicyClient { | 17 class CHROMEOS_EXPORT FakeAuthPolicyClient : public AuthPolicyClient { |
| 17 public: | 18 public: |
| 18 FakeAuthPolicyClient(); | 19 FakeAuthPolicyClient(); |
| 19 ~FakeAuthPolicyClient() override; | 20 ~FakeAuthPolicyClient() override; |
| 20 | 21 |
| 21 // DBusClient overrides. | 22 // DBusClient overrides. |
| 22 void Init(dbus::Bus* bus) override; | 23 void Init(dbus::Bus* bus) override; |
| 23 // AuthPolicyClient overrides. | 24 // AuthPolicyClient overrides. |
| 24 void JoinAdDomain(const std::string& machine_name, | 25 void JoinAdDomain(const std::string& machine_name, |
| 25 const std::string& user, | 26 const std::string& user, |
| 26 int password_fd, | 27 int password_fd, |
| 27 const JoinCallback& callback) override; | 28 const JoinCallback& callback) override; |
| 28 void RefreshDevicePolicy(const RefreshPolicyCallback& calllback) override; | 29 void RefreshDevicePolicy(const RefreshPolicyCallback& callback) override; |
| 29 void RefreshUserPolicy(const std::string& account_id, | 30 void RefreshUserPolicy(const std::string& account_id, |
| 30 const RefreshPolicyCallback& calllback) override; | 31 const RefreshPolicyCallback& callback) override; |
| 31 | 32 |
| 32 private: | 33 private: |
| 34 // Called after the empty device policy file has been written. |
| 35 void OnDevicePolicyFileWritten(const RefreshPolicyCallback& callback, |
| 36 bool success); |
| 37 |
| 38 base::WeakPtrFactory<FakeAuthPolicyClient> weak_factory_; |
| 39 |
| 33 DISALLOW_COPY_AND_ASSIGN(FakeAuthPolicyClient); | 40 DISALLOW_COPY_AND_ASSIGN(FakeAuthPolicyClient); |
| 34 }; | 41 }; |
| 35 | 42 |
| 36 } // namespace chromeos | 43 } // namespace chromeos |
| 37 | 44 |
| 38 #endif // CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ | 45 #endif // CHROMEOS_DBUS_FAKE_AUTH_POLICY_CLIENT_H_ |
| OLD | NEW |