Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4338)

Unified Diff: chromeos/dbus/auth_policy_client.h

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: nit Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | chromeos/dbus/auth_policy_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/auth_policy_client.h
diff --git a/chromeos/dbus/auth_policy_client.h b/chromeos/dbus/auth_policy_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..550edea4e9eb75ecb573fdaf59f6d078a4ff1d69
--- /dev/null
+++ b/chromeos/dbus/auth_policy_client.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
+#define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client.h"
+
+// TODO(rsorokin): Switch to service constants when it's landed.
+// (see crbug.com/659732)
+namespace authpolicy {
+enum ADJoinErrorType {
+ AD_JOIN_ERROR_NONE = 0,
+ AD_JOIN_ERROR_UNKNOWN = 1,
+ AD_JOIN_ERROR_DBUS_FAIL = 2,
+};
+}
+
+namespace chromeos {
+
+// AuthPolicyClient is used to communicate with the org.chromium.AuthPolicy
+// sevice. All method should be called from the origin thread (UI thread) which
+// initializes the DBusThreadManager instance.
+class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient {
+ public:
+ using JoinCallback = base::Callback<void(int error_code)>;
+
+ ~AuthPolicyClient() override;
+
+ // Factory function, creates a new instance and returns ownership.
+ // For normal usage, access the singleton via DBusThreadManager::Get().
+ static AuthPolicyClient* Create();
+
+ // TODO(rsorokin): Write more descriptive comment.
hashimoto 2016/11/07 02:34:18 Could you resolve this TODO?
+ // Calls JoinADDomain. Uses |machine_name| to join it to the domain. |user|,
+ // |password_fd| are credentials of the AD user which have right to join the
+ // domain. |password_fd| is a file descriptor password is read from.
+ // The caller should close it after the call.
+ // |callback| is called after the method call succeeds.
+ virtual void JoinAdDomain(const std::string& machine_name,
+ const std::string& user,
+ int password_fd,
+ const JoinCallback& callback) = 0;
+
+ protected:
+ // Create() should be used instead.
+ AuthPolicyClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | chromeos/dbus/auth_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698