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

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

Issue 2822773002: [subresource_filter] Force the popup blocker on sites with activation (Closed)
Patch Set: engedy review Created 3 years, 8 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/subresource_filter/subresource_filter_browsertest.cc » ('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 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 #if BUILDFLAG(ENABLE_PLUGINS) 2521 #if BUILDFLAG(ENABLE_PLUGINS)
2522 if (FlashDownloadInterception::ShouldStopFlashDownloadAction( 2522 if (FlashDownloadInterception::ShouldStopFlashDownloadAction(
2523 content_settings, opener_top_level_frame_url, target_url, 2523 content_settings, opener_top_level_frame_url, target_url,
2524 user_gesture)) { 2524 user_gesture)) {
2525 FlashDownloadInterception::InterceptFlashDownloadNavigation( 2525 FlashDownloadInterception::InterceptFlashDownloadNavigation(
2526 web_contents, opener_top_level_frame_url); 2526 web_contents, opener_top_level_frame_url);
2527 return false; 2527 return false;
2528 } 2528 }
2529 #endif 2529 #endif
2530 2530
2531 if (!user_gesture && 2531 auto* driver_factory = subresource_filter::
2532 ContentSubresourceFilterDriverFactory::FromWebContents(web_contents);
2533 const bool popup_block_candidate =
2534 !user_gesture ||
2535 (driver_factory &&
2536 driver_factory->throttle_manager()->ShouldDisallowNewWindow());
2537 if (popup_block_candidate &&
2532 !base::CommandLine::ForCurrentProcess()->HasSwitch( 2538 !base::CommandLine::ForCurrentProcess()->HasSwitch(
2533 switches::kDisablePopupBlocking)) { 2539 switches::kDisablePopupBlocking)) {
2534 if (content_settings->GetContentSetting( 2540 if (content_settings->GetContentSetting(
2535 opener_top_level_frame_url, opener_top_level_frame_url, 2541 opener_top_level_frame_url, opener_top_level_frame_url,
2536 CONTENT_SETTINGS_TYPE_POPUPS, 2542 CONTENT_SETTINGS_TYPE_POPUPS,
2537 std::string()) != CONTENT_SETTING_ALLOW) { 2543 std::string()) != CONTENT_SETTING_ALLOW) {
2538 BlockedWindowParams blocked_params(target_url, referrer, frame_name, 2544 BlockedWindowParams blocked_params(target_url, referrer, frame_name,
2539 disposition, features, user_gesture, 2545 disposition, features, user_gesture,
2540 opener_suppressed); 2546 opener_suppressed);
2541 HandleBlockedPopupOnUIThread(blocked_params, opener, web_contents); 2547 HandleBlockedPopupOnUIThread(blocked_params, opener, web_contents);
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
3611 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3617 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3612 return variations::GetVariationParamValue( 3618 return variations::GetVariationParamValue(
3613 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3619 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3614 } 3620 }
3615 3621
3616 // static 3622 // static
3617 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3623 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3618 const storage::QuotaSettings* settings) { 3624 const storage::QuotaSettings* settings) {
3619 g_default_quota_settings = settings; 3625 g_default_quota_settings = settings;
3620 } 3626 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/subresource_filter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698