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

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

Issue 450833002: Add additional UMA stats for remembering certificate decisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT Created 6 years, 4 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 | Annotate | Revision Log
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 1677
1678 void ChromeContentBrowserClient::AllowCertificateError( 1678 void ChromeContentBrowserClient::AllowCertificateError(
1679 int render_process_id, 1679 int render_process_id,
1680 int render_frame_id, 1680 int render_frame_id,
1681 int cert_error, 1681 int cert_error,
1682 const net::SSLInfo& ssl_info, 1682 const net::SSLInfo& ssl_info,
1683 const GURL& request_url, 1683 const GURL& request_url,
1684 ResourceType resource_type, 1684 ResourceType resource_type,
1685 bool overridable, 1685 bool overridable,
1686 bool strict_enforcement, 1686 bool strict_enforcement,
1687 bool expired_previous_decision,
1687 const base::Callback<void(bool)>& callback, 1688 const base::Callback<void(bool)>& callback,
1688 content::CertificateRequestResultType* result) { 1689 content::CertificateRequestResultType* result) {
1689 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { 1690 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
1690 // A sub-resource has a certificate error. The user doesn't really 1691 // A sub-resource has a certificate error. The user doesn't really
1691 // have a context for making the right decision, so block the 1692 // have a context for making the right decision, so block the
1692 // request hard, without an info bar to allow showing the insecure 1693 // request hard, without an info bar to allow showing the insecure
1693 // content. 1694 // content.
1694 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; 1695 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
1695 return; 1696 return;
1696 } 1697 }
(...skipping 17 matching lines...) Expand all
1714 1715
1715 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 1716 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
1716 CaptivePortalTabHelper* captive_portal_tab_helper = 1717 CaptivePortalTabHelper* captive_portal_tab_helper =
1717 CaptivePortalTabHelper::FromWebContents(tab); 1718 CaptivePortalTabHelper::FromWebContents(tab);
1718 if (captive_portal_tab_helper) 1719 if (captive_portal_tab_helper)
1719 captive_portal_tab_helper->OnSSLCertError(ssl_info); 1720 captive_portal_tab_helper->OnSSLCertError(ssl_info);
1720 #endif 1721 #endif
1721 1722
1722 // Otherwise, display an SSL blocking page. The interstitial page takes 1723 // Otherwise, display an SSL blocking page. The interstitial page takes
1723 // ownership of ssl_blocking_page. 1724 // ownership of ssl_blocking_page.
1725 int options_mask = 0;
1726 if (overridable)
1727 options_mask = SSLBlockingPage::OVERRIDABLE;
1728 if (strict_enforcement)
1729 options_mask = SSLBlockingPage::STRICT_ENFORCEMENT;
1730 if (expired_previous_decision)
1731 options_mask = SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED;
1724 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage( 1732 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage(
1725 tab, cert_error, ssl_info, request_url, overridable, 1733 tab, cert_error, ssl_info, request_url, options_mask, callback);
1726 strict_enforcement, callback);
1727 ssl_blocking_page->Show(); 1734 ssl_blocking_page->Show();
1728 } 1735 }
1729 1736
1730 void ChromeContentBrowserClient::SelectClientCertificate( 1737 void ChromeContentBrowserClient::SelectClientCertificate(
1731 int render_process_id, 1738 int render_process_id,
1732 int render_frame_id, 1739 int render_frame_id,
1733 const net::HttpNetworkSession* network_session, 1740 const net::HttpNetworkSession* network_session,
1734 net::SSLCertRequestInfo* cert_request_info, 1741 net::SSLCertRequestInfo* cert_request_info,
1735 const base::Callback<void(net::X509Certificate*)>& callback) { 1742 const base::Callback<void(net::X509Certificate*)>& callback) {
1736 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( 1743 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 switches::kDisableWebRtcEncryption, 2639 switches::kDisableWebRtcEncryption,
2633 }; 2640 };
2634 to_command_line->CopySwitchesFrom(from_command_line, 2641 to_command_line->CopySwitchesFrom(from_command_line,
2635 kWebRtcDevSwitchNames, 2642 kWebRtcDevSwitchNames,
2636 arraysize(kWebRtcDevSwitchNames)); 2643 arraysize(kWebRtcDevSwitchNames));
2637 } 2644 }
2638 } 2645 }
2639 #endif // defined(ENABLE_WEBRTC) 2646 #endif // defined(ENABLE_WEBRTC)
2640 2647
2641 } // namespace chrome 2648 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/ssl/chrome_ssl_host_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698