OLD | NEW |
---|---|
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 #include "chrome/browser/search/instant_service_factory.h" | 63 #include "chrome/browser/search/instant_service_factory.h" |
64 #include "chrome/browser/search/search.h" | 64 #include "chrome/browser/search/search.h" |
65 #include "chrome/browser/search_engines/search_provider_install_state_message_fi lter.h" | 65 #include "chrome/browser/search_engines/search_provider_install_state_message_fi lter.h" |
66 #include "chrome/browser/signin/principals_message_filter.h" | 66 #include "chrome/browser/signin/principals_message_filter.h" |
67 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" | 67 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
68 #include "chrome/browser/speech/tts_controller.h" | 68 #include "chrome/browser/speech/tts_controller.h" |
69 #include "chrome/browser/speech/tts_message_filter.h" | 69 #include "chrome/browser/speech/tts_message_filter.h" |
70 #include "chrome/browser/ssl/ssl_add_certificate.h" | 70 #include "chrome/browser/ssl/ssl_add_certificate.h" |
71 #include "chrome/browser/ssl/ssl_blocking_page.h" | 71 #include "chrome/browser/ssl/ssl_blocking_page.h" |
72 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | 72 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
73 #include "chrome/browser/ssl/ssl_error_handler.h" | |
74 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" | |
73 #include "chrome/browser/tab_contents/tab_util.h" | 75 #include "chrome/browser/tab_contents/tab_util.h" |
74 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 76 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
75 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 77 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
76 #include "chrome/browser/ui/chrome_select_file_policy.h" | 78 #include "chrome/browser/ui/chrome_select_file_policy.h" |
77 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 79 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
78 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 80 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
79 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 81 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
80 #include "chrome/common/chrome_constants.h" | 82 #include "chrome/common/chrome_constants.h" |
81 #include "chrome/common/chrome_paths.h" | 83 #include "chrome/common/chrome_paths.h" |
82 #include "chrome/common/chrome_switches.h" | 84 #include "chrome/common/chrome_switches.h" |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1715 } | 1717 } |
1716 | 1718 |
1717 prerender::PrerenderContents* prerender_contents = | 1719 prerender::PrerenderContents* prerender_contents = |
1718 prerender::PrerenderContents::FromWebContents(tab); | 1720 prerender::PrerenderContents::FromWebContents(tab); |
1719 if (prerender_contents) { | 1721 if (prerender_contents) { |
1720 prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR); | 1722 prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR); |
1721 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL; | 1723 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL; |
1722 return; | 1724 return; |
1723 } | 1725 } |
1724 | 1726 |
1725 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | |
1726 CaptivePortalTabHelper* captive_portal_tab_helper = | |
1727 CaptivePortalTabHelper::FromWebContents(tab); | |
1728 if (captive_portal_tab_helper) | |
1729 captive_portal_tab_helper->OnSSLCertError(ssl_info); | |
1730 #endif | |
1731 | |
1732 // Otherwise, display an SSL blocking page. The interstitial page takes | 1727 // Otherwise, display an SSL blocking page. The interstitial page takes |
1733 // ownership of ssl_blocking_page. | 1728 // ownership of ssl_blocking_page. |
1734 int options_mask = 0; | 1729 int options_mask = 0; |
1735 if (overridable) | 1730 if (overridable) |
1736 options_mask |= SSLBlockingPage::OVERRIDABLE; | 1731 options_mask |= SSLBlockingPage::OVERRIDABLE; |
1737 if (strict_enforcement) | 1732 if (strict_enforcement) |
1738 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; | 1733 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; |
1739 if (expired_previous_decision) | 1734 if (expired_previous_decision) |
1740 options_mask |= SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED; | 1735 options_mask |= SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED; |
1741 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage( | 1736 |
1742 tab, cert_error, ssl_info, request_url, options_mask, callback); | 1737 // SSL interstitials aren't delayed if captive portal detection is disabled. |
1743 ssl_blocking_page->Show(); | 1738 base::TimeDelta ssl_error_delay; |
1739 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | |
1740 CaptivePortalTabHelper* captive_portal_tab_helper = | |
1741 CaptivePortalTabHelper::FromWebContents(tab); | |
1742 if (captive_portal_tab_helper) { | |
1743 captive_portal_tab_helper->OnSSLCertError(ssl_info); | |
1744 ssl_error_delay = captive_portal_tab_helper->GetSSLErrorDelay(); | |
1745 } | |
1746 #endif | |
mmenke
2014/10/30 19:28:01
I think this code makes much more sense in SSLErro
meacer
2014/11/06 21:21:55
Moved to SSLErrorHandler. The tests depend on Capt
| |
1747 | |
1748 SSLErrorHandler* ssl_error_handler = new SSLErrorHandler( | |
mmenke
2014/10/30 19:28:01
Suggest making this a static function, since nothi
meacer
2014/11/06 21:21:55
Done.
| |
1749 tab, cert_error, ssl_info, request_url, | |
1750 options_mask, | |
1751 ssl_error_delay, | |
1752 callback); | |
mmenke
2014/10/30 19:28:01
nit: Should either fit args in as few lines as po
meacer
2014/11/06 21:21:55
Done.
| |
1753 ssl_error_handler->Handle(); | |
1744 } | 1754 } |
1745 | 1755 |
1746 void ChromeContentBrowserClient::SelectClientCertificate( | 1756 void ChromeContentBrowserClient::SelectClientCertificate( |
1747 int render_process_id, | 1757 int render_process_id, |
1748 int render_frame_id, | 1758 int render_frame_id, |
1749 net::SSLCertRequestInfo* cert_request_info, | 1759 net::SSLCertRequestInfo* cert_request_info, |
1750 const base::Callback<void(net::X509Certificate*)>& callback) { | 1760 const base::Callback<void(net::X509Certificate*)>& callback) { |
1751 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( | 1761 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( |
1752 render_process_id, render_frame_id); | 1762 render_process_id, render_frame_id); |
1753 WebContents* tab = WebContents::FromRenderFrameHost(rfh); | 1763 WebContents* tab = WebContents::FromRenderFrameHost(rfh); |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2610 switches::kDisableWebRtcEncryption, | 2620 switches::kDisableWebRtcEncryption, |
2611 }; | 2621 }; |
2612 to_command_line->CopySwitchesFrom(from_command_line, | 2622 to_command_line->CopySwitchesFrom(from_command_line, |
2613 kWebRtcDevSwitchNames, | 2623 kWebRtcDevSwitchNames, |
2614 arraysize(kWebRtcDevSwitchNames)); | 2624 arraysize(kWebRtcDevSwitchNames)); |
2615 } | 2625 } |
2616 } | 2626 } |
2617 #endif // defined(ENABLE_WEBRTC) | 2627 #endif // defined(ENABLE_WEBRTC) |
2618 | 2628 |
2619 } // namespace chrome | 2629 } // namespace chrome |
OLD | NEW |