| OLD | NEW |
| 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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 security_style_explanations->secure_explanations.push_back( | 1408 security_style_explanations->secure_explanations.push_back( |
| 1409 content::SecurityStyleExplanation( | 1409 content::SecurityStyleExplanation( |
| 1410 l10n_util::GetStringUTF8(IDS_SECURE_PROTOCOL_AND_CIPHERSUITE), | 1410 l10n_util::GetStringUTF8(IDS_SECURE_PROTOCOL_AND_CIPHERSUITE), |
| 1411 l10n_util::GetStringUTF8( | 1411 l10n_util::GetStringUTF8( |
| 1412 IDS_SECURE_PROTOCOL_AND_CIPHERSUITE_DESCRIPTION))); | 1412 IDS_SECURE_PROTOCOL_AND_CIPHERSUITE_DESCRIPTION))); |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 return security_style; | 1415 return security_style; |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 void Browser::GetCertificateTransparencySummary(bool is_valid_ev, |
| 1419 int num_unknown_scts, |
| 1420 int num_invalid_scts, |
| 1421 int num_valid_scts, |
| 1422 std::string* summary) { |
| 1423 if (num_unknown_scts == 0 && num_invalid_scts == 0 && num_valid_scts == 0) { |
| 1424 // No SCTs - no CT information. |
| 1425 *summary = |
| 1426 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_NOT_PRESENT); |
| 1427 } else if (num_valid_scts > 0) { |
| 1428 // Any valid SCT. |
| 1429 if (is_valid_ev) |
| 1430 *summary = |
| 1431 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_VALID_EV); |
| 1432 else |
| 1433 *summary = |
| 1434 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_VALID); |
| 1435 } else if (num_invalid_scts > 0) { |
| 1436 // Any invalid SCT. |
| 1437 *summary = |
| 1438 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_INVALID); |
| 1439 } else { |
| 1440 // All SCTs are from unknown logs. |
| 1441 *summary = |
| 1442 l10n_util::GetStringUTF8(IDS_SIGNED_CERTIFICATE_TIMESTAMPS_UNKNOWN); |
| 1443 } |
| 1444 } |
| 1445 |
| 1418 void Browser::ShowCertificateViewerInDevTools( | 1446 void Browser::ShowCertificateViewerInDevTools( |
| 1419 content::WebContents* web_contents, int cert_id) { | 1447 content::WebContents* web_contents, int cert_id) { |
| 1420 DevToolsWindow* devtools_window = | 1448 DevToolsWindow* devtools_window = |
| 1421 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents); | 1449 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents); |
| 1422 if (devtools_window) | 1450 if (devtools_window) |
| 1423 devtools_window->ShowCertificateViewer(cert_id); | 1451 devtools_window->ShowCertificateViewer(cert_id); |
| 1424 } | 1452 } |
| 1425 | 1453 |
| 1426 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( | 1454 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( |
| 1427 content::WebContents* web_contents, | 1455 content::WebContents* web_contents, |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2738 if (contents && !allow_js_access) { | 2766 if (contents && !allow_js_access) { |
| 2739 contents->web_contents()->GetController().LoadURL( | 2767 contents->web_contents()->GetController().LoadURL( |
| 2740 target_url, | 2768 target_url, |
| 2741 content::Referrer(), | 2769 content::Referrer(), |
| 2742 ui::PAGE_TRANSITION_LINK, | 2770 ui::PAGE_TRANSITION_LINK, |
| 2743 std::string()); // No extra headers. | 2771 std::string()); // No extra headers. |
| 2744 } | 2772 } |
| 2745 | 2773 |
| 2746 return contents != NULL; | 2774 return contents != NULL; |
| 2747 } | 2775 } |
| OLD | NEW |