| 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" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/certificate_viewer.h" | 13 #include "chrome/browser/certificate_viewer.h" |
| 14 #include "chrome/browser/platform_util.h" | 14 #include "chrome/browser/platform_util.h" |
| 15 #include "chrome/browser/ui/browser_dialogs.h" | 15 #include "chrome/browser/ui/browser_dialogs.h" |
| 16 #include "chrome/browser/ui/certificate_dialogs.h" | 16 #include "chrome/browser/ui/certificate_dialogs.h" |
| 17 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" | 17 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" |
| 18 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 18 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 19 #include "chrome/common/net/x509_certificate_model.h" | 19 #include "chrome/common/net/x509_certificate_model.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/grit/generated_resources.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 22 #include "grit/generated_resources.h" | |
| 23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/gfx/size.h" | 24 #include "ui/gfx/size.h" |
| 25 | 25 |
| 26 using content::WebContents; | 26 using content::WebContents; |
| 27 using content::WebUIMessageHandler; | 27 using content::WebUIMessageHandler; |
| 28 using web_modal::NativeWebContentsModalDialog; | 28 using web_modal::NativeWebContentsModalDialog; |
| 29 | 29 |
| 30 // Shows a certificate using the WebUI certificate viewer. | 30 // Shows a certificate using the WebUI certificate viewer. |
| 31 void ShowCertificateViewer(WebContents* web_contents, | 31 void ShowCertificateViewer(WebContents* web_contents, |
| 32 gfx::NativeWindow parent, | 32 gfx::NativeWindow parent, |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 const base::ListValue* args) const { | 446 const base::ListValue* args) const { |
| 447 int cert_index; | 447 int cert_index; |
| 448 double val; | 448 double val; |
| 449 if (!(args->GetDouble(0, &val))) | 449 if (!(args->GetDouble(0, &val))) |
| 450 return -1; | 450 return -1; |
| 451 cert_index = static_cast<int>(val); | 451 cert_index = static_cast<int>(val); |
| 452 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) | 452 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) |
| 453 return -1; | 453 return -1; |
| 454 return cert_index; | 454 return cert_index; |
| 455 } | 455 } |
| OLD | NEW |