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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 dialog_(NULL) { | 221 dialog_(NULL) { |
222 } | 222 } |
223 | 223 |
224 CertificateViewerDialog::~CertificateViewerDialog() { | 224 CertificateViewerDialog::~CertificateViewerDialog() { |
225 } | 225 } |
226 | 226 |
227 void CertificateViewerDialog::Show(WebContents* web_contents, | 227 void CertificateViewerDialog::Show(WebContents* web_contents, |
228 gfx::NativeWindow parent) { | 228 gfx::NativeWindow parent) { |
229 // TODO(bshe): UI tweaks needed for Aura HTML Dialog, such as adding padding | 229 // TODO(bshe): UI tweaks needed for Aura HTML Dialog, such as adding padding |
230 // on the title for Aura ConstrainedWebDialogUI. | 230 // on the title for Aura ConstrainedWebDialogUI. |
231 dialog_ = CreateConstrainedWebDialog(web_contents->GetBrowserContext(), this, | 231 dialog_ = ShowConstrainedWebDialog(web_contents->GetBrowserContext(), this, |
232 web_contents); | 232 web_contents); |
233 } | 233 } |
234 | 234 |
235 NativeWebContentsModalDialog | 235 NativeWebContentsModalDialog |
236 CertificateViewerDialog::GetNativeWebContentsModalDialog() { | 236 CertificateViewerDialog::GetNativeWebContentsModalDialog() { |
237 return dialog_->GetNativeDialog(); | 237 return dialog_->GetNativeDialog(); |
238 } | 238 } |
239 | 239 |
240 GURL CertificateViewerDialog::GetDialogContentURL() const { | 240 GURL CertificateViewerDialog::GetDialogContentURL() const { |
241 return GURL(chrome::kChromeUICertificateViewerURL); | 241 return GURL(chrome::kChromeUICertificateViewerURL); |
242 } | 242 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 const base::ListValue* args) const { | 443 const base::ListValue* args) const { |
444 int cert_index; | 444 int cert_index; |
445 double val; | 445 double val; |
446 if (!(args->GetDouble(0, &val))) | 446 if (!(args->GetDouble(0, &val))) |
447 return -1; | 447 return -1; |
448 cert_index = static_cast<int>(val); | 448 cert_index = static_cast<int>(val); |
449 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) | 449 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) |
450 return -1; | 450 return -1; |
451 return cert_index; | 451 return cert_index; |
452 } | 452 } |
OLD | NEW |