OLD | NEW |
---|---|
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 return; | 108 return; |
109 } | 109 } |
110 const cryptohome::Identification cryptohome_identification(account_id); | 110 const cryptohome::Identification cryptohome_identification(account_id); |
111 const std::string sanitized_username = | 111 const std::string sanitized_username = |
112 chromeos::CryptohomeClient::GetStubSanitizedUsername( | 112 chromeos::CryptohomeClient::GetStubSanitizedUsername( |
113 cryptohome_identification); | 113 cryptohome_identification); |
114 policy_path = policy_path.AppendASCII(sanitized_username); | 114 policy_path = policy_path.AppendASCII(sanitized_username); |
115 policy_path = policy_path.AppendASCII("stub_policy"); | 115 policy_path = policy_path.AppendASCII("stub_policy"); |
116 | 116 |
117 em::CloudPolicySettings policy; | 117 em::CloudPolicySettings policy; |
118 | |
119 // DELETE_ME | |
emaxx
2016/12/28 19:09:20
Wrong change?
Thiemo Nagel
2016/12/29 15:08:28
Thanks. Deleted. ;)
| |
120 em::StringPolicyProto string_policy; | |
121 string_policy.set_value("[{\"url\": \"google.com\", \"name\": \"Google\"}]"); | |
122 *(policy.mutable_managedbookmarks()) = string_policy; | |
123 // END_DELETE_ME | |
124 | |
118 std::string payload; | 125 std::string payload; |
119 CHECK(policy.SerializeToString(&payload)); | 126 CHECK(policy.SerializeToString(&payload)); |
120 | 127 |
121 // Drop file for SessionManagerClientStubImpl to read. | 128 // Drop file for SessionManagerClientStubImpl to read. |
122 if (!base::PostTaskAndReplyWithResult( | 129 if (!base::PostTaskAndReplyWithResult( |
123 base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(), | 130 base::WorkerPool::GetTaskRunner(false /* task_is_slow */).get(), |
124 FROM_HERE, base::Bind(&WritePolicyFile, policy_path, payload, | 131 FROM_HERE, base::Bind(&WritePolicyFile, policy_path, payload, |
125 "google/chromeos/user"), | 132 "google/chromeos/user"), |
126 callback)) { | 133 callback)) { |
127 callback.Run(false); | 134 callback.Run(false); |
128 } | 135 } |
129 } | 136 } |
130 | 137 |
131 } // namespace chromeos | 138 } // namespace chromeos |
OLD | NEW |