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

Side by Side Diff: chromeos/dbus/auth_policy_client.cc

Issue 2601283002: Use AccountIdKey to identify Active Directory accounts. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | chromeos/login/auth/cryptohome_authenticator.cc » ('j') | 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 #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/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "components/signin/core/account_id/account_id.h" 8 #include "components/signin/core/account_id/account_id.h"
9 #include "dbus/bus.h" 9 #include "dbus/bus.h"
10 #include "dbus/message.h" 10 #include "dbus/message.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, 54 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface,
55 authpolicy::kAuthPolicyRefreshDevicePolicy); 55 authpolicy::kAuthPolicyRefreshDevicePolicy);
56 proxy_->CallMethod( 56 proxy_->CallMethod(
57 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 57 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
58 base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback, 58 base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback,
59 weak_ptr_factory_.GetWeakPtr(), callback)); 59 weak_ptr_factory_.GetWeakPtr(), callback));
60 } 60 }
61 61
62 void RefreshUserPolicy(const AccountId& account_id, 62 void RefreshUserPolicy(const AccountId& account_id,
63 const RefreshPolicyCallback& callback) override { 63 const RefreshPolicyCallback& callback) override {
64 DCHECK(account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY);
64 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, 65 dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface,
65 authpolicy::kAuthPolicyRefreshUserPolicy); 66 authpolicy::kAuthPolicyRefreshUserPolicy);
66 dbus::MessageWriter writer(&method_call); 67 dbus::MessageWriter writer(&method_call);
67 writer.AppendString(account_id.GetObjGuid()); 68 writer.AppendString(account_id.GetAccountIdKey());
Thiemo Nagel 2016/12/29 16:58:20 I'm already changing this in https://codereview.ch
68 proxy_->CallMethod( 69 proxy_->CallMethod(
69 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 70 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
70 base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback, 71 base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback,
71 weak_ptr_factory_.GetWeakPtr(), callback)); 72 weak_ptr_factory_.GetWeakPtr(), callback));
72 } 73 }
73 74
74 protected: 75 protected:
75 void Init(dbus::Bus* bus) override { 76 void Init(dbus::Bus* bus) override {
76 bus_ = bus; 77 bus_ = bus;
77 proxy_ = bus_->GetObjectProxy( 78 proxy_ = bus_->GetObjectProxy(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 AuthPolicyClient::AuthPolicyClient() {} 151 AuthPolicyClient::AuthPolicyClient() {}
151 152
152 AuthPolicyClient::~AuthPolicyClient() {} 153 AuthPolicyClient::~AuthPolicyClient() {}
153 154
154 // static 155 // static
155 AuthPolicyClient* AuthPolicyClient::Create() { 156 AuthPolicyClient* AuthPolicyClient::Create() {
156 return new AuthPolicyClientImpl(); 157 return new AuthPolicyClientImpl();
157 } 158 }
158 159
159 } // namespace chromeos 160 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/login/auth/cryptohome_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698