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/ui/webui/settings/certificates_handler.h" | 5 #include "chrome/browser/ui/webui/settings/certificates_handler.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 ~CertIdMap() {} | 201 ~CertIdMap() {} |
202 | 202 |
203 std::string CertToId(net::X509Certificate* cert); | 203 std::string CertToId(net::X509Certificate* cert); |
204 net::X509Certificate* IdToCert(const std::string& id); | 204 net::X509Certificate* IdToCert(const std::string& id); |
205 net::X509Certificate* CallbackArgsToCert(const base::ListValue* args); | 205 net::X509Certificate* CallbackArgsToCert(const base::ListValue* args); |
206 | 206 |
207 private: | 207 private: |
208 typedef std::map<net::X509Certificate*, int32_t> CertMap; | 208 typedef std::map<net::X509Certificate*, int32_t> CertMap; |
209 | 209 |
210 // Creates an ID for cert and looks up the cert for an ID. | 210 // Creates an ID for cert and looks up the cert for an ID. |
211 IDMap<net::X509Certificate> id_map_; | 211 IDMap<net::X509Certificate*> id_map_; |
212 | 212 |
213 // Finds the ID for a cert. | 213 // Finds the ID for a cert. |
214 CertMap cert_map_; | 214 CertMap cert_map_; |
215 | 215 |
216 DISALLOW_COPY_AND_ASSIGN(CertIdMap); | 216 DISALLOW_COPY_AND_ASSIGN(CertIdMap); |
217 }; | 217 }; |
218 | 218 |
219 std::string CertIdMap::CertToId(net::X509Certificate* cert) { | 219 std::string CertIdMap::CertToId(net::X509Certificate* cert) { |
220 CertMap::const_iterator iter = cert_map_.find(cert); | 220 CertMap::const_iterator iter = cert_map_.find(cert); |
221 if (iter != cert_map_.end()) | 221 if (iter != cert_map_.end()) |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 error_info->Set(kCertificateErrors, | 1140 error_info->Set(kCertificateErrors, |
1141 base::WrapUnique(cert_error_list.release())); | 1141 base::WrapUnique(cert_error_list.release())); |
1142 RejectCallback(*error_info); | 1142 RejectCallback(*error_info); |
1143 } | 1143 } |
1144 | 1144 |
1145 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { | 1145 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { |
1146 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1146 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
1147 } | 1147 } |
1148 | 1148 |
1149 } // namespace settings | 1149 } // namespace settings |
OLD | NEW |