| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/policy/test/local_policy_test_server.h" | 5 #include "chrome/browser/policy/test/local_policy_test_server.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "chrome/browser/policy/cloud_policy_constants.h" | 15 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
| 16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 17 #include "crypto/rsa_private_key.h" | 17 #include "crypto/rsa_private_key.h" |
| 18 #include "net/test/base_test_server.h" | 18 #include "net/test/base_test_server.h" |
| 19 #include "net/test/python_utils.h" | 19 #include "net/test/python_utils.h" |
| 20 | 20 |
| 21 namespace policy { | 21 namespace policy { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Filename in the temporary directory storing the policy data. | 25 // Filename in the temporary directory storing the policy data. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 std::string LocalPolicyTestServer::GetSelector(const std::string& type, | 228 std::string LocalPolicyTestServer::GetSelector(const std::string& type, |
| 229 const std::string& entity_id) { | 229 const std::string& entity_id) { |
| 230 std::string selector = type; | 230 std::string selector = type; |
| 231 if (!entity_id.empty()) | 231 if (!entity_id.empty()) |
| 232 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); | 232 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); |
| 233 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); | 233 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); |
| 234 return selector; | 234 return selector; |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace policy; | 237 } // namespace policy; |
| OLD | NEW |