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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | chromeos/dbus/auth_policy_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
6 #define CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/dbus/dbus_client.h"
13
14 // TODO(rsorokin): Switch to service constants when it's landed.
15 // (see crbug.com/659732)
16 namespace authpolicy {
17 enum ADJoinErrorType {
18 AD_JOIN_ERROR_NONE = 0,
19 AD_JOIN_ERROR_UNKNOWN = 1,
20 AD_JOIN_ERROR_DBUS_FAIL = 2,
21 };
22 }
23
24 namespace chromeos {
25
26 // AuthPolicyClient is used to communicate with the org.chromium.AuthPolicy
27 // sevice. All method should be called from the origin thread (UI thread) which
28 // initializes the DBusThreadManager instance.
29 class CHROMEOS_EXPORT AuthPolicyClient : public DBusClient {
30 public:
31 using JoinCallback = base::Callback<void(int error_code)>;
32
33 ~AuthPolicyClient() override;
34
35 // Factory function, creates a new instance and returns ownership.
36 // For normal usage, access the singleton via DBusThreadManager::Get().
37 static AuthPolicyClient* Create();
38
39 // TODO(rsorokin): Write more descriptive comment.
hashimoto 2016/11/07 02:34:18 Could you resolve this TODO?
40 // 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
42 // domain. |password_fd| is a file descriptor password is read from.
43 // The caller should close it after the call.
44 // |callback| is called after the method call succeeds.
45 virtual void JoinAdDomain(const std::string& machine_name,
46 const std::string& user,
47 int password_fd,
48 const JoinCallback& callback) = 0;
49
50 protected:
51 // Create() should be used instead.
52 AuthPolicyClient();
53
54 private:
55 DISALLOW_COPY_AND_ASSIGN(AuthPolicyClient);
56 };
57
58 } // namespace chromeos
59
60 #endif // CHROMEOS_DBUS_AUTH_POLICY_CLIENT_H_
OLDNEW
« 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