OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_api.h" | 5 #include "extensions/browser/api/networking_private/networking_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 DCHECK(policy_dict); | 1048 DCHECK(policy_dict); |
1049 // private_api::GlobalPolicy is a subset of the global policy dictionary | 1049 // private_api::GlobalPolicy is a subset of the global policy dictionary |
1050 // (by definition), so use the api setter/getter to generate the subset. | 1050 // (by definition), so use the api setter/getter to generate the subset. |
1051 std::unique_ptr<private_api::GlobalPolicy> policy( | 1051 std::unique_ptr<private_api::GlobalPolicy> policy( |
1052 private_api::GlobalPolicy::FromValue(*policy_dict)); | 1052 private_api::GlobalPolicy::FromValue(*policy_dict)); |
1053 DCHECK(policy); | 1053 DCHECK(policy); |
1054 return RespondNow( | 1054 return RespondNow( |
1055 ArgumentList(private_api::GetGlobalPolicy::Results::Create(*policy))); | 1055 ArgumentList(private_api::GetGlobalPolicy::Results::Create(*policy))); |
1056 } | 1056 } |
1057 | 1057 |
| 1058 //////////////////////////////////////////////////////////////////////////////// |
| 1059 // NetworkingPrivateGetCertificateListsFunction |
| 1060 |
| 1061 NetworkingPrivateGetCertificateListsFunction:: |
| 1062 ~NetworkingPrivateGetCertificateListsFunction() {} |
| 1063 |
| 1064 ExtensionFunction::ResponseAction |
| 1065 NetworkingPrivateGetCertificateListsFunction::Run() { |
| 1066 if (!HasPrivateNetworkingAccess(extension(), source_context_type(), |
| 1067 source_url())) { |
| 1068 return RespondNow(Error(kPrivateOnlyError)); |
| 1069 } |
| 1070 |
| 1071 std::unique_ptr<base::DictionaryValue> certificate_lists( |
| 1072 GetDelegate(browser_context())->GetCertificateLists()); |
| 1073 DCHECK(certificate_lists); |
| 1074 return RespondNow(OneArgument(std::move(certificate_lists))); |
| 1075 } |
| 1076 |
1058 } // namespace extensions | 1077 } // namespace extensions |
OLD | NEW |