| 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 #include "chromeos/dbus/auth_policy_client.h" | 4 #include "chromeos/dbus/auth_policy_client.h" |
| 5 | 5 |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "components/signin/core/account_id/account_id.h" | 9 #include "components/signin/core/account_id/account_id.h" |
| 10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 writer.AppendString(machine_name); | 50 writer.AppendString(machine_name); |
| 51 writer.AppendString(user_principal_name); | 51 writer.AppendString(user_principal_name); |
| 52 writer.AppendFileDescriptor(password_fd); | 52 writer.AppendFileDescriptor(password_fd); |
| 53 proxy_->CallMethod( | 53 proxy_->CallMethod( |
| 54 &method_call, kSlowDbusTimeoutMilliseconds, | 54 &method_call, kSlowDbusTimeoutMilliseconds, |
| 55 base::Bind(&AuthPolicyClientImpl::HandleJoinCallback, | 55 base::Bind(&AuthPolicyClientImpl::HandleJoinCallback, |
| 56 weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback))); | 56 weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback))); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void AuthenticateUser(const std::string& user_principal_name, | 59 void AuthenticateUser(const std::string& user_principal_name, |
| 60 const std::string& object_guid, |
| 60 int password_fd, | 61 int password_fd, |
| 61 AuthCallback callback) override { | 62 AuthCallback callback) override { |
| 62 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, | 63 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, |
| 63 authpolicy::kAuthPolicyAuthenticateUser); | 64 authpolicy::kAuthPolicyAuthenticateUser); |
| 64 dbus::MessageWriter writer(&method_call); | 65 dbus::MessageWriter writer(&method_call); |
| 65 writer.AppendString(user_principal_name); | 66 writer.AppendString(user_principal_name); |
| 67 writer.AppendString(object_guid); |
| 66 writer.AppendFileDescriptor(password_fd); | 68 writer.AppendFileDescriptor(password_fd); |
| 67 proxy_->CallMethod( | 69 proxy_->CallMethod( |
| 68 &method_call, kSlowDbusTimeoutMilliseconds, | 70 &method_call, kSlowDbusTimeoutMilliseconds, |
| 69 base::Bind(&AuthPolicyClientImpl::HandleAuthCallback, | 71 base::Bind(&AuthPolicyClientImpl::HandleAuthCallback, |
| 70 weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback))); | 72 weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback))); |
| 71 } | 73 } |
| 72 | 74 |
| 73 void RefreshDevicePolicy(RefreshPolicyCallback callback) override { | 75 void RefreshDevicePolicy(RefreshPolicyCallback callback) override { |
| 74 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, | 76 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, |
| 75 authpolicy::kAuthPolicyRefreshDevicePolicy); | 77 authpolicy::kAuthPolicyRefreshDevicePolicy); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 AuthPolicyClient::AuthPolicyClient() {} | 159 AuthPolicyClient::AuthPolicyClient() {} |
| 158 | 160 |
| 159 AuthPolicyClient::~AuthPolicyClient() {} | 161 AuthPolicyClient::~AuthPolicyClient() {} |
| 160 | 162 |
| 161 // static | 163 // static |
| 162 AuthPolicyClient* AuthPolicyClient::Create() { | 164 AuthPolicyClient* AuthPolicyClient::Create() { |
| 163 return new AuthPolicyClientImpl(); | 165 return new AuthPolicyClientImpl(); |
| 164 } | 166 } |
| 165 | 167 |
| 166 } // namespace chromeos | 168 } // namespace chromeos |
| OLD | NEW |