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

Unified Diff: chromeos/dbus/auth_policy_client.cc

Issue 2685793004: Chromad: Wire up displayName and givenName (Closed)
Patch Set: Combine SetDisplayName and SetGivenName into SetDisplayAndGiveName Created 3 years, 10 months 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/dbus/auth_policy_client.h ('k') | chromeos/dbus/fake_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.cc
diff --git a/chromeos/dbus/auth_policy_client.cc b/chromeos/dbus/auth_policy_client.cc
index ade93a726162a0636355cc7ae02736887434c719..4e82e771798ca3e6fc58282a5ed5f1fe5318d342 100644
--- a/chromeos/dbus/auth_policy_client.cc
+++ b/chromeos/dbus/auth_policy_client.cc
@@ -123,17 +123,25 @@ class AuthPolicyClientImpl : public AuthPolicyClient {
void HandleAuthCallback(const AuthCallback& callback,
dbus::Response* response) {
+ authpolicy::ActiveDirectoryAccountData account_data;
if (!response) {
DLOG(ERROR) << "Auth: Failed to call to authpolicy";
- callback.Run(authpolicy::ERROR_DBUS_FAILURE, std::string());
+ callback.Run(authpolicy::ERROR_DBUS_FAILURE, account_data);
return;
}
dbus::MessageReader reader(response);
const authpolicy::ErrorType error(GetErrorFromReader(&reader));
- std::string user_id;
- if (!reader.PopString(&user_id))
+ if (reader.PopArrayOfBytesAsProto(&account_data)) {
+ callback.Run(error, account_data);
+ return;
+ }
+ DLOG(WARNING) << "Failed to parse protobuf. Fallback to string";
+ // TODO(rsorokin): Remove once both ChromiumOS and Chromium use protobuf.
+ std::string account_id;
+ if (!reader.PopString(&account_id))
DLOG(ERROR) << "Auth: Failed to get user_id from the response";
- callback.Run(error, user_id);
+ account_data.set_account_id(account_id);
+ callback.Run(error, account_data);
}
dbus::Bus* bus_ = nullptr;
« no previous file with comments | « chromeos/dbus/auth_policy_client.h ('k') | chromeos/dbus/fake_auth_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698