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

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

Issue 1589703002: Surface SCT (Signed Certificate Timestamp) counts in the Security panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 security_style_explanations->secure_explanations.push_back( 1407 security_style_explanations->secure_explanations.push_back(
1408 content::SecurityStyleExplanation( 1408 content::SecurityStyleExplanation(
1409 l10n_util::GetStringUTF8(IDS_SECURE_PROTOCOL_AND_CIPHERSUITE), 1409 l10n_util::GetStringUTF8(IDS_SECURE_PROTOCOL_AND_CIPHERSUITE),
1410 l10n_util::GetStringUTF8( 1410 l10n_util::GetStringUTF8(
1411 IDS_SECURE_PROTOCOL_AND_CIPHERSUITE_DESCRIPTION))); 1411 IDS_SECURE_PROTOCOL_AND_CIPHERSUITE_DESCRIPTION)));
1412 } 1412 }
1413 1413
1414 return security_style; 1414 return security_style;
1415 } 1415 }
1416 1416
1417 void Browser::GetCertificateTransparencySummary(bool is_valid_ev,
pfeldman 2016/01/23 01:04:55 So we are introducing remote debugging method so t
lgarron 2016/01/23 01:20:15 Yes, exactly. :-/
Ryan Sleevi 2016/01/23 01:24:34 I'm not sure I understand what you're asking.
lgarron 2016/01/26 02:33:26 Fundamentally, this CL is about calculating a stri
1418 int num_unknown_scts,
1419 int num_invalid_scts,
1420 int num_valid_scts,
1421 std::string* summary) {
1422 if (num_unknown_scts == 0 && num_invalid_scts == 0 && num_valid_scts == 0) {
1423 // No SCTs - no CT information.
1424 *summary =
1425 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_NOT_PRESENT);
1426 } else if (num_valid_scts > 0) {
1427 // Any valid SCT.
1428 if (is_valid_ev)
1429 *summary =
1430 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_VALID_EV);
1431 else
1432 *summary =
1433 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_VALID);
1434 } else if (num_invalid_scts > 0) {
1435 // Any invalid SCT.
1436 *summary =
1437 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_INVALID);
1438 } else {
1439 // All SCTs are from unknown logs.
1440 *summary =
1441 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_UNKNOWN);
1442 }
1443 }
1444
1417 void Browser::ShowCertificateViewerInDevTools( 1445 void Browser::ShowCertificateViewerInDevTools(
1418 content::WebContents* web_contents, int cert_id) { 1446 content::WebContents* web_contents, int cert_id) {
1419 DevToolsWindow* devtools_window = 1447 DevToolsWindow* devtools_window =
1420 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents); 1448 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents);
1421 if (devtools_window) 1449 if (devtools_window)
1422 devtools_window->ShowCertificateViewer(cert_id); 1450 devtools_window->ShowCertificateViewer(cert_id);
1423 } 1451 }
1424 1452
1425 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( 1453 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser(
1426 content::WebContents* web_contents, 1454 content::WebContents* web_contents,
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 if (contents && !allow_js_access) { 2765 if (contents && !allow_js_access) {
2738 contents->web_contents()->GetController().LoadURL( 2766 contents->web_contents()->GetController().LoadURL(
2739 target_url, 2767 target_url,
2740 content::Referrer(), 2768 content::Referrer(),
2741 ui::PAGE_TRANSITION_LINK, 2769 ui::PAGE_TRANSITION_LINK,
2742 std::string()); // No extra headers. 2770 std::string()); // No extra headers.
2743 } 2771 }
2744 2772
2745 return contents != NULL; 2773 return contents != NULL;
2746 } 2774 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698