| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/session_manager_client.h" | 5 #include "chromeos/dbus/session_manager_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 const std::string& account_name, | 268 const std::string& account_name, |
| 269 const std::string& policy_blob, | 269 const std::string& policy_blob, |
| 270 const StorePolicyCallback& callback) override { | 270 const StorePolicyCallback& callback) override { |
| 271 CallStorePolicyByUsername( | 271 CallStorePolicyByUsername( |
| 272 login_manager::kSessionManagerStoreDeviceLocalAccountPolicy, | 272 login_manager::kSessionManagerStoreDeviceLocalAccountPolicy, |
| 273 account_name, | 273 account_name, |
| 274 policy_blob, | 274 policy_blob, |
| 275 callback); | 275 callback); |
| 276 } | 276 } |
| 277 | 277 |
| 278 bool SupportsRestartToApplyUserFlags() const override { return true; } |
| 279 |
| 278 void SetFlagsForUser(const cryptohome::Identification& cryptohome_id, | 280 void SetFlagsForUser(const cryptohome::Identification& cryptohome_id, |
| 279 const std::vector<std::string>& flags) override { | 281 const std::vector<std::string>& flags) override { |
| 280 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 282 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 281 login_manager::kSessionManagerSetFlagsForUser); | 283 login_manager::kSessionManagerSetFlagsForUser); |
| 282 dbus::MessageWriter writer(&method_call); | 284 dbus::MessageWriter writer(&method_call); |
| 283 writer.AppendString(cryptohome_id.id()); | 285 writer.AppendString(cryptohome_id.id()); |
| 284 writer.AppendArrayOfStrings(flags); | 286 writer.AppendArrayOfStrings(flags); |
| 285 session_manager_proxy_->CallMethod( | 287 session_manager_proxy_->CallMethod( |
| 286 &method_call, | 288 &method_call, |
| 287 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 289 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 base::Bind(&StoreFile, stub_policy_path, policy_blob), | 935 base::Bind(&StoreFile, stub_policy_path, policy_blob), |
| 934 base::Bind(callback, true)); | 936 base::Bind(callback, true)); |
| 935 } | 937 } |
| 936 void StoreDeviceLocalAccountPolicy( | 938 void StoreDeviceLocalAccountPolicy( |
| 937 const std::string& account_id, | 939 const std::string& account_id, |
| 938 const std::string& policy_blob, | 940 const std::string& policy_blob, |
| 939 const StorePolicyCallback& callback) override { | 941 const StorePolicyCallback& callback) override { |
| 940 StorePolicyForUser(cryptohome::Identification::FromString(account_id), | 942 StorePolicyForUser(cryptohome::Identification::FromString(account_id), |
| 941 policy_blob, callback); | 943 policy_blob, callback); |
| 942 } | 944 } |
| 945 |
| 946 bool SupportsRestartToApplyUserFlags() const override { return false; } |
| 947 |
| 943 void SetFlagsForUser(const cryptohome::Identification& cryptohome_id, | 948 void SetFlagsForUser(const cryptohome::Identification& cryptohome_id, |
| 944 const std::vector<std::string>& flags) override {} | 949 const std::vector<std::string>& flags) override {} |
| 945 | 950 |
| 946 void GetServerBackedStateKeys(const StateKeysCallback& callback) override { | 951 void GetServerBackedStateKeys(const StateKeysCallback& callback) override { |
| 947 std::vector<std::string> state_keys; | 952 std::vector<std::string> state_keys; |
| 948 for (int i = 0; i < 5; ++i) | 953 for (int i = 0; i < 5; ++i) |
| 949 state_keys.push_back(crypto::SHA256HashString(base::IntToString(i))); | 954 state_keys.push_back(crypto::SHA256HashString(base::IntToString(i))); |
| 950 | 955 |
| 951 if (!callback.is_null()) | 956 if (!callback.is_null()) |
| 952 callback.Run(state_keys); | 957 callback.Run(state_keys); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 | 1010 |
| 1006 SessionManagerClient* SessionManagerClient::Create( | 1011 SessionManagerClient* SessionManagerClient::Create( |
| 1007 DBusClientImplementationType type) { | 1012 DBusClientImplementationType type) { |
| 1008 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 1013 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 1009 return new SessionManagerClientImpl(); | 1014 return new SessionManagerClientImpl(); |
| 1010 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); | 1015 DCHECK_EQ(FAKE_DBUS_CLIENT_IMPLEMENTATION, type); |
| 1011 return new SessionManagerClientStubImpl(); | 1016 return new SessionManagerClientStubImpl(); |
| 1012 } | 1017 } |
| 1013 | 1018 |
| 1014 } // namespace chromeos | 1019 } // namespace chromeos |
| OLD | NEW |