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

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

Issue 578373002: Interstitial options are not OR'd properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Changed API to pass options_mask through Created 6 years, 3 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 (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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 return new ChromeQuotaPermissionContext(); 1663 return new ChromeQuotaPermissionContext();
1664 } 1664 }
1665 1665
1666 void ChromeContentBrowserClient::AllowCertificateError( 1666 void ChromeContentBrowserClient::AllowCertificateError(
1667 int render_process_id, 1667 int render_process_id,
1668 int render_frame_id, 1668 int render_frame_id,
1669 int cert_error, 1669 int cert_error,
1670 const net::SSLInfo& ssl_info, 1670 const net::SSLInfo& ssl_info,
1671 const GURL& request_url, 1671 const GURL& request_url,
1672 ResourceType resource_type, 1672 ResourceType resource_type,
1673 bool overridable, 1673 int options_mask,
1674 bool strict_enforcement,
1675 bool expired_previous_decision,
1676 const base::Callback<void(bool)>& callback, 1674 const base::Callback<void(bool)>& callback,
1677 content::CertificateRequestResultType* result) { 1675 content::CertificateRequestResultType* result) {
1678 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { 1676 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
1679 // A sub-resource has a certificate error. The user doesn't really 1677 // A sub-resource has a certificate error. The user doesn't really
1680 // have a context for making the right decision, so block the 1678 // have a context for making the right decision, so block the
1681 // request hard, without an info bar to allow showing the insecure 1679 // request hard, without an info bar to allow showing the insecure
1682 // content. 1680 // content.
1683 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; 1681 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
1684 return; 1682 return;
1685 } 1683 }
(...skipping 17 matching lines...) Expand all
1703 1701
1704 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 1702 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
1705 CaptivePortalTabHelper* captive_portal_tab_helper = 1703 CaptivePortalTabHelper* captive_portal_tab_helper =
1706 CaptivePortalTabHelper::FromWebContents(tab); 1704 CaptivePortalTabHelper::FromWebContents(tab);
1707 if (captive_portal_tab_helper) 1705 if (captive_portal_tab_helper)
1708 captive_portal_tab_helper->OnSSLCertError(ssl_info); 1706 captive_portal_tab_helper->OnSSLCertError(ssl_info);
1709 #endif 1707 #endif
1710 1708
1711 // Otherwise, display an SSL blocking page. The interstitial page takes 1709 // Otherwise, display an SSL blocking page. The interstitial page takes
1712 // ownership of ssl_blocking_page. 1710 // ownership of ssl_blocking_page.
1713 int options_mask = 0;
1714 if (overridable)
1715 options_mask = SSLBlockingPage::OVERRIDABLE;
Charlie Reis 2014/09/19 20:00:12 Yikes. Yeah, this isn't much of a bitmask.
1716 if (strict_enforcement)
1717 options_mask = SSLBlockingPage::STRICT_ENFORCEMENT;
1718 if (expired_previous_decision)
1719 options_mask = SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED;
1720 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage( 1711 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage(
1721 tab, cert_error, ssl_info, request_url, options_mask, callback); 1712 tab, cert_error, ssl_info, request_url, options_mask, callback);
1722 ssl_blocking_page->Show(); 1713 ssl_blocking_page->Show();
1723 } 1714 }
1724 1715
1725 void ChromeContentBrowserClient::SelectClientCertificate( 1716 void ChromeContentBrowserClient::SelectClientCertificate(
1726 int render_process_id, 1717 int render_process_id,
1727 int render_frame_id, 1718 int render_frame_id,
1728 const net::HttpNetworkSession* network_session, 1719 const net::HttpNetworkSession* network_session,
1729 net::SSLCertRequestInfo* cert_request_info, 1720 net::SSLCertRequestInfo* cert_request_info,
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 switches::kDisableWebRtcEncryption, 2583 switches::kDisableWebRtcEncryption,
2593 }; 2584 };
2594 to_command_line->CopySwitchesFrom(from_command_line, 2585 to_command_line->CopySwitchesFrom(from_command_line,
2595 kWebRtcDevSwitchNames, 2586 kWebRtcDevSwitchNames,
2596 arraysize(kWebRtcDevSwitchNames)); 2587 arraysize(kWebRtcDevSwitchNames));
2597 } 2588 }
2598 } 2589 }
2599 #endif // defined(ENABLE_WEBRTC) 2590 #endif // defined(ENABLE_WEBRTC)
2600 2591
2601 } // namespace chrome 2592 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698