Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/ui/webui/certificate_viewer_webui.cc

Issue 15894032: Change Certificate Viewer WebUI to match new style. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Documentation Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/certificate_viewer.html ('k') | ui/webui/resources/css/tabs.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10 matching lines...) Expand all
21 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/gfx/size.h" 23 #include "ui/gfx/size.h"
24 #include "ui/web_dialogs/web_dialog_observer.h" 24 #include "ui/web_dialogs/web_dialog_observer.h"
25 25
26 using content::WebContents; 26 using content::WebContents;
27 using content::WebUIMessageHandler; 27 using content::WebUIMessageHandler;
28 using ui::WebDialogObserver; 28 using ui::WebDialogObserver;
29 using web_modal::NativeWebContentsModalDialog; 29 using web_modal::NativeWebContentsModalDialog;
30 30
31 namespace {
32
33 // Default width/height of the dialog.
34 const int kDefaultWidth = 580;
35 const int kDefaultHeight = 600;
36
37 } // namespace
38
39 // Shows a certificate using the WebUI certificate viewer. 31 // Shows a certificate using the WebUI certificate viewer.
40 void ShowCertificateViewer(WebContents* web_contents, 32 void ShowCertificateViewer(WebContents* web_contents,
41 gfx::NativeWindow parent, 33 gfx::NativeWindow parent,
42 net::X509Certificate* cert) { 34 net::X509Certificate* cert) {
43 CertificateViewerDialog* dialog = new CertificateViewerDialog(cert); 35 CertificateViewerDialog* dialog = new CertificateViewerDialog(cert);
44 dialog->Show(web_contents, parent); 36 dialog->Show(web_contents, parent);
45 } 37 }
46 38
47 //////////////////////////////////////////////////////////////////////////////// 39 ////////////////////////////////////////////////////////////////////////////////
48 // CertificateViewerDialog 40 // CertificateViewerDialog
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 GURL CertificateViewerDialog::GetDialogContentURL() const { 83 GURL CertificateViewerDialog::GetDialogContentURL() const {
92 return GURL(chrome::kChromeUICertificateViewerURL); 84 return GURL(chrome::kChromeUICertificateViewerURL);
93 } 85 }
94 86
95 void CertificateViewerDialog::GetWebUIMessageHandlers( 87 void CertificateViewerDialog::GetWebUIMessageHandlers(
96 std::vector<WebUIMessageHandler*>* handlers) const { 88 std::vector<WebUIMessageHandler*>* handlers) const {
97 handlers->push_back(new CertificateViewerDialogHandler(window_, cert_)); 89 handlers->push_back(new CertificateViewerDialogHandler(window_, cert_));
98 } 90 }
99 91
100 void CertificateViewerDialog::GetDialogSize(gfx::Size* size) const { 92 void CertificateViewerDialog::GetDialogSize(gfx::Size* size) const {
93 const int kDefaultWidth = 544;
94 const int kDefaultHeight = 628;
101 size->SetSize(kDefaultWidth, kDefaultHeight); 95 size->SetSize(kDefaultWidth, kDefaultHeight);
102 } 96 }
103 97
104 std::string CertificateViewerDialog::GetDialogArgs() const { 98 std::string CertificateViewerDialog::GetDialogArgs() const {
105 std::string data; 99 std::string data;
106 100
107 // Certificate information. The keys in this dictionary's general key 101 // Certificate information. The keys in this dictionary's general key
108 // correspond to the IDs in the Html page. 102 // correspond to the IDs in the Html page.
109 DictionaryValue cert_info; 103 DictionaryValue cert_info;
110 net::X509Certificate::OSCertHandle cert_hnd = cert_->os_cert_handle(); 104 net::X509Certificate::OSCertHandle cert_hnd = cert_->os_cert_handle();
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 const base::ListValue* args) const { 399 const base::ListValue* args) const {
406 int cert_index; 400 int cert_index;
407 double val; 401 double val;
408 if (!(args->GetDouble(0, &val))) 402 if (!(args->GetDouble(0, &val)))
409 return -1; 403 return -1;
410 cert_index = static_cast<int>(val); 404 cert_index = static_cast<int>(val);
411 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()))
412 return -1; 406 return -1;
413 return cert_index; 407 return cert_index;
414 } 408 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/certificate_viewer.html ('k') | ui/webui/resources/css/tabs.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698