| 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_AUTH_POLICY_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ | 6 #define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient { | 29 class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient { |
| 30 public: | 30 public: |
| 31 using JoinCallback = base::Callback<void(int error_code)>; | 31 using JoinCallback = base::Callback<void(int error_code)>; |
| 32 | 32 |
| 33 ~AuthPolicyClient() override; | 33 ~AuthPolicyClient() override; |
| 34 | 34 |
| 35 // Factory function, creates a new instance and returns ownership. | 35 // Factory function, creates a new instance and returns ownership. |
| 36 // For normal usage, access the singleton via DBusThreadManager::Get(). | 36 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 37 static AuthPolicyClient* Create(); | 37 static AuthPolicyClient* Create(); |
| 38 | 38 |
| 39 // Signal upstart to start authpolicyd. |
| 40 virtual void StartService() = 0; |
| 39 // TODO(rsorokin): Write more descriptive comment. | 41 // TODO(rsorokin): Write more descriptive comment. |
| 40 // Calls JoinADDomain. Uses |machine_name| to join it to the domain. |user|, | 42 // Calls JoinADDomain. Uses |machine_name| to join it to the domain. |user|, |
| 41 // |password_fd| are credentials of the AD user which have right to join the | 43 // |password_fd| are credentials of the AD user which have right to join the |
| 42 // domain. |password_fd| is a file descriptor password is read from. | 44 // domain. |password_fd| is a file descriptor password is read from. |
| 43 // The caller should close it after the call. | 45 // The caller should close it after the call. |
| 44 // |callback| is called after the method call succeeds. | 46 // |callback| is called after the method call succeeds. |
| 45 virtual void JoinAdDomain(const std::string& machine_name, | 47 virtual void JoinAdDomain(const std::string& machine_name, |
| 46 const std::string& user, | 48 const std::string& user, |
| 47 int password_fd, | 49 int password_fd, |
| 48 const JoinCallback& callback) = 0; | 50 const JoinCallback& callback) = 0; |
| 49 | 51 |
| 50 protected: | 52 protected: |
| 51 // Create() should be used instead. | 53 // Create() should be used instead. |
| 52 AuthPolicyClient(); | 54 AuthPolicyClient(); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient); | 57 DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace chromeos | 60 } // namespace chromeos |
| 59 | 61 |
| 60 #endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ | 62 #endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_ |
| OLD | NEW |