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( | 231 dialog_ = CreateConstrainedWebDialog(web_contents->GetBrowserContext(), this, |
232 web_contents->GetBrowserContext(), | 232 web_contents); |
233 this, | |
234 NULL, | |
235 web_contents); | |
236 } | 233 } |
237 | 234 |
238 NativeWebContentsModalDialog | 235 NativeWebContentsModalDialog |
239 CertificateViewerDialog::GetNativeWebContentsModalDialog() { | 236 CertificateViewerDialog::GetNativeWebContentsModalDialog() { |
240 return dialog_->GetNativeDialog(); | 237 return dialog_->GetNativeDialog(); |
241 } | 238 } |
242 | 239 |
243 GURL CertificateViewerDialog::GetDialogContentURL() const { | 240 GURL CertificateViewerDialog::GetDialogContentURL() const { |
244 return GURL(chrome::kChromeUICertificateViewerURL); | 241 return GURL(chrome::kChromeUICertificateViewerURL); |
245 } | 242 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 const base::ListValue* args) const { | 443 const base::ListValue* args) const { |
447 int cert_index; | 444 int cert_index; |
448 double val; | 445 double val; |
449 if (!(args->GetDouble(0, &val))) | 446 if (!(args->GetDouble(0, &val))) |
450 return -1; | 447 return -1; |
451 cert_index = static_cast<int>(val); | 448 cert_index = static_cast<int>(val); |
452 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())) |
453 return -1; | 450 return -1; |
454 return cert_index; | 451 return cert_index; |
455 } | 452 } |
OLD | NEW |