Chromium Code Reviews| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 618 return; | 618 return; |
| 619 } | 619 } |
| 620 | 620 |
| 621 PopupBlockerTabHelper* popup_helper = | 621 PopupBlockerTabHelper* popup_helper = |
| 622 PopupBlockerTabHelper::FromWebContents(tab); | 622 PopupBlockerTabHelper::FromWebContents(tab); |
| 623 if (!popup_helper) | 623 if (!popup_helper) |
| 624 return; | 624 return; |
| 625 popup_helper->AddBlockedPopup(params); | 625 popup_helper->AddBlockedPopup(params); |
| 626 } | 626 } |
| 627 | 627 |
| 628 #if defined(ENABLE_PLUGINS) | |
| 629 void HandleFlashDownloadActionOnUIThread(int render_process_id, | |
|
Lei Zhang
2016/09/30 01:22:46
DCHECK_CURRENTLY_ON(...)
raymes
2016/09/30 01:53:18
Done.
| |
| 630 int render_frame_id) { | |
| 631 RenderFrameHost* render_frame_host = | |
| 632 RenderFrameHost::FromID(render_process_id, render_frame_id); | |
| 633 if (!render_frame_host) | |
| 634 return; | |
| 635 WebContents* web_contents = | |
| 636 WebContents::FromRenderFrameHost(render_frame_host); | |
| 637 FlashDownloadInterception::InterceptFlashDownloadNavigation(web_contents); | |
| 638 } | |
| 639 #endif // defined(ENABLE_PLUGINS) | |
| 640 | |
| 628 // An implementation of the SSLCertReporter interface used by | 641 // An implementation of the SSLCertReporter interface used by |
| 629 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid | 642 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid |
| 630 // certificate reports. | 643 // certificate reports. |
| 631 class SafeBrowsingSSLCertReporter : public SSLCertReporter { | 644 class SafeBrowsingSSLCertReporter : public SSLCertReporter { |
| 632 public: | 645 public: |
| 633 explicit SafeBrowsingSSLCertReporter( | 646 explicit SafeBrowsingSSLCertReporter( |
| 634 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>& | 647 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>& |
| 635 safe_browsing_ui_manager) | 648 safe_browsing_ui_manager) |
| 636 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {} | 649 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {} |
| 637 ~SafeBrowsingSSLCertReporter() override {} | 650 ~SafeBrowsingSSLCertReporter() override {} |
| (...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2272 } | 2285 } |
| 2273 #endif | 2286 #endif |
| 2274 | 2287 |
| 2275 HostContentSettingsMap* content_settings = | 2288 HostContentSettingsMap* content_settings = |
| 2276 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); | 2289 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); |
| 2277 | 2290 |
| 2278 #if defined(ENABLE_PLUGINS) | 2291 #if defined(ENABLE_PLUGINS) |
| 2279 if (FlashDownloadInterception::ShouldStopFlashDownloadAction( | 2292 if (FlashDownloadInterception::ShouldStopFlashDownloadAction( |
| 2280 content_settings, opener_top_level_frame_url, target_url, | 2293 content_settings, opener_top_level_frame_url, target_url, |
| 2281 user_gesture)) { | 2294 user_gesture)) { |
| 2282 // TODO(crbug.com/626728): Implement permission prompt logic. | 2295 BrowserThread::PostTask( |
| 2296 BrowserThread::UI, FROM_HERE, | |
| 2297 base::Bind(&HandleFlashDownloadActionOnUIThread, render_process_id, | |
| 2298 opener_render_frame_id)); | |
| 2283 return false; | 2299 return false; |
| 2284 } | 2300 } |
| 2285 #endif | 2301 #endif |
| 2286 | 2302 |
| 2287 BlockedWindowParams blocked_params(target_url, | 2303 BlockedWindowParams blocked_params(target_url, |
| 2288 referrer, | 2304 referrer, |
| 2289 frame_name, | 2305 frame_name, |
| 2290 disposition, | 2306 disposition, |
| 2291 features, | 2307 features, |
| 2292 user_gesture, | 2308 user_gesture, |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3222 if (channel <= kMaxDisableEncryptionChannel) { | 3238 if (channel <= kMaxDisableEncryptionChannel) { |
| 3223 static const char* const kWebRtcDevSwitchNames[] = { | 3239 static const char* const kWebRtcDevSwitchNames[] = { |
| 3224 switches::kDisableWebRtcEncryption, | 3240 switches::kDisableWebRtcEncryption, |
| 3225 }; | 3241 }; |
| 3226 to_command_line->CopySwitchesFrom(from_command_line, | 3242 to_command_line->CopySwitchesFrom(from_command_line, |
| 3227 kWebRtcDevSwitchNames, | 3243 kWebRtcDevSwitchNames, |
| 3228 arraysize(kWebRtcDevSwitchNames)); | 3244 arraysize(kWebRtcDevSwitchNames)); |
| 3229 } | 3245 } |
| 3230 } | 3246 } |
| 3231 #endif // defined(ENABLE_WEBRTC) | 3247 #endif // defined(ENABLE_WEBRTC) |
| OLD | NEW |