| 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 "chrome/browser/chromeos/arc/arc_policy_bridge.h" | 5 #include "chrome/browser/chromeos/arc/arc_policy_bridge.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 continue; | 167 continue; |
| 168 | 168 |
| 169 std::string x509_data; | 169 std::string x509_data; |
| 170 if (!certificate->GetStringWithoutPathExpansion(::onc::certificate::kX509, | 170 if (!certificate->GetStringWithoutPathExpansion(::onc::certificate::kX509, |
| 171 &x509_data)) { | 171 &x509_data)) { |
| 172 continue; | 172 continue; |
| 173 } | 173 } |
| 174 | 174 |
| 175 base::DictionaryValue data; | 175 base::DictionaryValue data; |
| 176 data.SetString("X509", x509_data); | 176 data.SetString("X509", x509_data); |
| 177 ca_certs->Append(data.DeepCopy()); | 177 ca_certs->Append(data.CreateDeepCopy()); |
| 178 } | 178 } |
| 179 filtered_policies->Set(kArcCaCerts, std::move(ca_certs)); | 179 filtered_policies->Set(kArcCaCerts, std::move(ca_certs)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 std::string GetFilteredJSONPolicies(const policy::PolicyMap& policy_map) { | 182 std::string GetFilteredJSONPolicies(const policy::PolicyMap& policy_map) { |
| 183 base::DictionaryValue filtered_policies; | 183 base::DictionaryValue filtered_policies; |
| 184 // Parse ArcPolicy as JSON string before adding other policies to the | 184 // Parse ArcPolicy as JSON string before adding other policies to the |
| 185 // dictionary. | 185 // dictionary. |
| 186 const base::Value* const app_policy_value = | 186 const base::Value* const app_policy_value = |
| 187 policy_map.GetValue(policy::key::kArcPolicy); | 187 policy_map.GetValue(policy::key::kArcPolicy); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 user_manager::UserManager::Get()->GetPrimaryUser(); | 309 user_manager::UserManager::Get()->GetPrimaryUser(); |
| 310 Profile* const profile = | 310 Profile* const profile = |
| 311 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); | 311 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); |
| 312 auto* profile_policy_connector = | 312 auto* profile_policy_connector = |
| 313 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile); | 313 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile); |
| 314 policy_service_ = profile_policy_connector->policy_service(); | 314 policy_service_ = profile_policy_connector->policy_service(); |
| 315 is_managed_ = profile_policy_connector->IsManaged(); | 315 is_managed_ = profile_policy_connector->IsManaged(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace arc | 318 } // namespace arc |
| OLD | NEW |