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

Side by Side Diff: chromeos/dbus/fake_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 unified diff | Download patch
« no previous file with comments | « chromeos/dbus/auth_policy_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4
5 #include "chromeos/dbus/fake_auth_policy_client.h" 5 #include "chromeos/dbus/fake_auth_policy_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return; 95 return;
96 } 96 }
97 97
98 callback.Run(authpolicy::ERROR_NONE); 98 callback.Run(authpolicy::ERROR_NONE);
99 } 99 }
100 100
101 void FakeAuthPolicyClient::AuthenticateUser( 101 void FakeAuthPolicyClient::AuthenticateUser(
102 const std::string& user_principal_name, 102 const std::string& user_principal_name,
103 int password_fd, 103 int password_fd,
104 const AuthCallback& callback) { 104 const AuthCallback& callback) {
105 callback.Run(authpolicy::ERROR_NONE, base::MD5String(user_principal_name)); 105 authpolicy::ActiveDirectoryAccountData account_data;
106 account_data.set_account_id(base::MD5String(user_principal_name));
107 callback.Run(authpolicy::ERROR_NONE, account_data);
106 } 108 }
107 109
108 void FakeAuthPolicyClient::RefreshDevicePolicy( 110 void FakeAuthPolicyClient::RefreshDevicePolicy(
109 const RefreshPolicyCallback& callback) { 111 const RefreshPolicyCallback& callback) {
110 base::FilePath policy_path; 112 base::FilePath policy_path;
111 if (!PathService::Get(chromeos::FILE_OWNER_KEY, &policy_path)) { 113 if (!PathService::Get(chromeos::FILE_OWNER_KEY, &policy_path)) {
112 callback.Run(false); 114 callback.Run(false);
113 return; 115 return;
114 } 116 }
115 policy_path = policy_path.DirName().AppendASCII("stub_device_policy"); 117 policy_path = policy_path.DirName().AppendASCII("stub_device_policy");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 .WithShutdownBehavior( 156 .WithShutdownBehavior(
155 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) 157 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
156 .WithPriority(base::TaskPriority::BACKGROUND) 158 .WithPriority(base::TaskPriority::BACKGROUND)
157 .MayBlock(), 159 .MayBlock(),
158 base::Bind(&WritePolicyFile, policy_path, payload, 160 base::Bind(&WritePolicyFile, policy_path, payload,
159 "google/chromeos/user"), 161 "google/chromeos/user"),
160 callback); 162 callback);
161 } 163 }
162 164
163 } // namespace chromeos 165 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/auth_policy_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698