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

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

Issue 2379833002: Hookup the window.open flash download interception to the permission prompt (Closed)
Patch Set: Hookup the window.open flash download interception to the permission prompt Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 return; 622 return;
623 } 623 }
624 624
625 PopupBlockerTabHelper* popup_helper = 625 PopupBlockerTabHelper* popup_helper =
626 PopupBlockerTabHelper::FromWebContents(tab); 626 PopupBlockerTabHelper::FromWebContents(tab);
627 if (!popup_helper) 627 if (!popup_helper)
628 return; 628 return;
629 popup_helper->AddBlockedPopup(params); 629 popup_helper->AddBlockedPopup(params);
630 } 630 }
631 631
632 #if defined(ENABLE_PLUGINS)
633 void HandleFlashDownloadActionOnUIThread(int render_process_id,
634 int render_frame_id) {
635 DCHECK_CURRENTLY_ON(BrowserThread::UI);
636 RenderFrameHost* render_frame_host =
637 RenderFrameHost::FromID(render_process_id, render_frame_id);
638 if (!render_frame_host)
639 return;
640 WebContents* web_contents =
641 WebContents::FromRenderFrameHost(render_frame_host);
642 FlashDownloadInterception::InterceptFlashDownloadNavigation(web_contents);
643 }
644 #endif // defined(ENABLE_PLUGINS)
645
632 // An implementation of the SSLCertReporter interface used by 646 // An implementation of the SSLCertReporter interface used by
633 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid 647 // SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid
634 // certificate reports. 648 // certificate reports.
635 class SafeBrowsingSSLCertReporter : public SSLCertReporter { 649 class SafeBrowsingSSLCertReporter : public SSLCertReporter {
636 public: 650 public:
637 explicit SafeBrowsingSSLCertReporter( 651 explicit SafeBrowsingSSLCertReporter(
638 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>& 652 const scoped_refptr<safe_browsing::SafeBrowsingUIManager>&
639 safe_browsing_ui_manager) 653 safe_browsing_ui_manager)
640 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {} 654 : safe_browsing_ui_manager_(safe_browsing_ui_manager) {}
641 ~SafeBrowsingSSLCertReporter() override {} 655 ~SafeBrowsingSSLCertReporter() override {}
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 } 2290 }
2277 #endif 2291 #endif
2278 2292
2279 HostContentSettingsMap* content_settings = 2293 HostContentSettingsMap* content_settings =
2280 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); 2294 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap();
2281 2295
2282 #if defined(ENABLE_PLUGINS) 2296 #if defined(ENABLE_PLUGINS)
2283 if (FlashDownloadInterception::ShouldStopFlashDownloadAction( 2297 if (FlashDownloadInterception::ShouldStopFlashDownloadAction(
2284 content_settings, opener_top_level_frame_url, target_url, 2298 content_settings, opener_top_level_frame_url, target_url,
2285 user_gesture)) { 2299 user_gesture)) {
2286 // TODO(crbug.com/626728): Implement permission prompt logic. 2300 BrowserThread::PostTask(
2301 BrowserThread::UI, FROM_HERE,
2302 base::Bind(&HandleFlashDownloadActionOnUIThread, render_process_id,
2303 opener_render_frame_id));
2287 return false; 2304 return false;
2288 } 2305 }
2289 #endif 2306 #endif
2290 2307
2291 BlockedWindowParams blocked_params(target_url, 2308 BlockedWindowParams blocked_params(target_url,
2292 referrer, 2309 referrer,
2293 frame_name, 2310 frame_name,
2294 disposition, 2311 disposition,
2295 features, 2312 features,
2296 user_gesture, 2313 user_gesture,
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3240 if (channel <= kMaxDisableEncryptionChannel) { 3257 if (channel <= kMaxDisableEncryptionChannel) {
3241 static const char* const kWebRtcDevSwitchNames[] = { 3258 static const char* const kWebRtcDevSwitchNames[] = {
3242 switches::kDisableWebRtcEncryption, 3259 switches::kDisableWebRtcEncryption,
3243 }; 3260 };
3244 to_command_line->CopySwitchesFrom(from_command_line, 3261 to_command_line->CopySwitchesFrom(from_command_line,
3245 kWebRtcDevSwitchNames, 3262 kWebRtcDevSwitchNames,
3246 arraysize(kWebRtcDevSwitchNames)); 3263 arraysize(kWebRtcDevSwitchNames));
3247 } 3264 }
3248 } 3265 }
3249 #endif // defined(ENABLE_WEBRTC) 3266 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698