| Index: chromeos/dbus/fake_session_manager_client.cc
|
| diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc
|
| index 594ecdc43e4201a5b8833719f684e0c6c92c04e2..5cc0066993b5bb057dabf2bc36887fbe31e0aeb7 100644
|
| --- a/chromeos/dbus/fake_session_manager_client.cc
|
| +++ b/chromeos/dbus/fake_session_manager_client.cc
|
| @@ -5,43 +5,13 @@
|
| #include "chromeos/dbus/fake_session_manager_client.h"
|
|
|
| #include "base/bind.h"
|
| -#include "base/files/file_path.h"
|
| -#include "base/files/file_util.h"
|
| #include "base/location.h"
|
| -#include "base/numerics/safe_conversions.h"
|
| -#include "base/path_service.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| -#include "chromeos/chromeos_paths.h"
|
| #include "chromeos/dbus/cryptohome_client.h"
|
| -#include "components/policy/proto/device_management_backend.pb.h"
|
|
|
| namespace chromeos {
|
| -
|
| -namespace {
|
| -
|
| -// Store the owner key in a file on the disk, so that it can be loaded by
|
| -// DeviceSettingsService and used e.g. for validating policy signatures in the
|
| -// integration tests. This is done on behalf of the real session manager, that
|
| -// would be managing the owner key file on Chrome OS.
|
| -bool StoreOwnerKey(const std::string& public_key) {
|
| - base::FilePath owner_key_path;
|
| - DCHECK(base::PathService::Get(FILE_OWNER_KEY, &owner_key_path));
|
| - if (!base::CreateDirectory(owner_key_path.DirName())) {
|
| - LOG(ERROR) << "Failed to create the directory for the owner key file";
|
| - return false;
|
| - }
|
| - if (base::WriteFile(owner_key_path, public_key.c_str(),
|
| - public_key.length()) !=
|
| - base::checked_cast<int>(public_key.length())) {
|
| - LOG(ERROR) << "Failed to store the owner key file";
|
| - return false;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -} // namespace
|
|
|
| FakeSessionManagerClient::FakeSessionManagerClient()
|
| : start_device_wipe_call_count_(0),
|
| @@ -151,27 +121,11 @@
|
| void FakeSessionManagerClient::StoreDevicePolicy(
|
| const std::string& policy_blob,
|
| const StorePolicyCallback& callback) {
|
| - enterprise_management::PolicyFetchResponse policy;
|
| - if (!policy.ParseFromString(policy_blob)) {
|
| - LOG(ERROR) << "Unable to parse policy protobuf";
|
| - base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE, base::Bind(callback, false /* success */));
|
| - return;
|
| - }
|
| -
|
| - bool owner_key_store_success = false;
|
| - if (policy.has_new_public_key())
|
| - owner_key_store_success = StoreOwnerKey(policy.new_public_key());
|
| device_policy_ = policy_blob;
|
| -
|
| - base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE, base::Bind(callback, true /* success */));
|
| - if (policy.has_new_public_key()) {
|
| - for (auto& observer : observers_)
|
| - observer.OwnerKeySet(owner_key_store_success);
|
| - }
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
|
| + base::Bind(callback, true));
|
| for (auto& observer : observers_)
|
| - observer.PropertyChangeComplete(true /* success */);
|
| + observer.PropertyChangeComplete(true);
|
| }
|
|
|
| void FakeSessionManagerClient::StorePolicyForUser(
|
|
|