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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 string16 CertificateViewerDialog::GetDialogTitle() const { | 79 string16 CertificateViewerDialog::GetDialogTitle() const { |
80 return title_; | 80 return title_; |
81 } | 81 } |
82 | 82 |
83 GURL CertificateViewerDialog::GetDialogContentURL() const { | 83 GURL CertificateViewerDialog::GetDialogContentURL() const { |
84 return GURL(chrome::kChromeUICertificateViewerURL); | 84 return GURL(chrome::kChromeUICertificateViewerURL); |
85 } | 85 } |
86 | 86 |
87 void CertificateViewerDialog::GetWebUIMessageHandlers( | 87 void CertificateViewerDialog::GetWebUIMessageHandlers( |
88 std::vector<WebUIMessageHandler*>* handlers) const { | 88 std::vector<WebUIMessageHandler*>* handlers) const { |
89 handlers->push_back(new CertificateViewerDialogHandler(window_, cert_)); | 89 handlers->push_back(new CertificateViewerDialogHandler(window_, cert_.get())); |
90 } | 90 } |
91 | 91 |
92 void CertificateViewerDialog::GetDialogSize(gfx::Size* size) const { | 92 void CertificateViewerDialog::GetDialogSize(gfx::Size* size) const { |
93 const int kDefaultWidth = 544; | 93 const int kDefaultWidth = 544; |
94 const int kDefaultHeight = 628; | 94 const int kDefaultHeight = 628; |
95 size->SetSize(kDefaultWidth, kDefaultHeight); | 95 size->SetSize(kDefaultWidth, kDefaultHeight); |
96 } | 96 } |
97 | 97 |
98 std::string CertificateViewerDialog::GetDialogArgs() const { | 98 std::string CertificateViewerDialog::GetDialogArgs() const { |
99 std::string data; | 99 std::string data; |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 const base::ListValue* args) const { | 399 const base::ListValue* args) const { |
400 int cert_index; | 400 int cert_index; |
401 double val; | 401 double val; |
402 if (!(args->GetDouble(0, &val))) | 402 if (!(args->GetDouble(0, &val))) |
403 return -1; | 403 return -1; |
404 cert_index = static_cast<int>(val); | 404 cert_index = static_cast<int>(val); |
405 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) | 405 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) |
406 return -1; | 406 return -1; |
407 return cert_index; | 407 return cert_index; |
408 } | 408 } |
OLD | NEW |