OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/certificate_viewer_webui.h" | 5 #include "chrome/browser/ui/webui/certificate_viewer_webui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (children) | 180 if (children) |
181 cert_node->Set("children", children); | 181 cert_node->Set("children", children); |
182 | 182 |
183 // Add this node to the children list for the next iteration. | 183 // Add this node to the children list for the next iteration. |
184 children = new base::ListValue(); | 184 children = new base::ListValue(); |
185 children->Append(cert_node); | 185 children->Append(cert_node); |
186 } | 186 } |
187 // Set the last node as the top of the certificate hierarchy. | 187 // Set the last node as the top of the certificate hierarchy. |
188 cert_info.Set("hierarchy", children); | 188 cert_info.Set("hierarchy", children); |
189 | 189 |
190 base::JSONWriter::Write(&cert_info, &data); | 190 base::JSONWriter::Write(cert_info, &data); |
191 | 191 |
192 return data; | 192 return data; |
193 } | 193 } |
194 | 194 |
195 void CertificateViewerModalDialog::OnDialogShown( | 195 void CertificateViewerModalDialog::OnDialogShown( |
196 content::WebUI* webui, | 196 content::WebUI* webui, |
197 content::RenderViewHost* render_view_host) { | 197 content::RenderViewHost* render_view_host) { |
198 webui_ = webui; | 198 webui_ = webui; |
199 } | 199 } |
200 | 200 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 const base::ListValue* args) const { | 438 const base::ListValue* args) const { |
439 int cert_index; | 439 int cert_index; |
440 double val; | 440 double val; |
441 if (!(args->GetDouble(0, &val))) | 441 if (!(args->GetDouble(0, &val))) |
442 return -1; | 442 return -1; |
443 cert_index = static_cast<int>(val); | 443 cert_index = static_cast<int>(val); |
444 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) | 444 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) |
445 return -1; | 445 return -1; |
446 return cert_index; | 446 return cert_index; |
447 } | 447 } |
OLD | NEW |