forked from uazo/cromite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisable-AdsBlockedInfoBar.patch
75 lines (70 loc) · 3.12 KB
/
disable-AdsBlockedInfoBar.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From: Zoraver Kang <[email protected]>
Date: Mon, 26 Aug 2019 17:54:28 -0400
Subject: disable AdsBlockedInfoBar
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../browser/profile_interaction_manager.cc | 48 -------------------
1 file changed, 48 deletions(-)
diff --git a/components/subresource_filter/content/browser/profile_interaction_manager.cc b/components/subresource_filter/content/browser/profile_interaction_manager.cc
--- a/components/subresource_filter/content/browser/profile_interaction_manager.cc
+++ b/components/subresource_filter/content/browser/profile_interaction_manager.cc
@@ -19,13 +19,6 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
-#if BUILDFLAG(IS_ANDROID)
-#include "components/infobars/content/content_infobar_manager.h" // nogncheck
-#include "components/messages/android/message_dispatcher_bridge.h"
-#include "components/messages/android/messages_feature.h"
-#include "components/subresource_filter/content/browser/ads_blocked_infobar_delegate.h"
-#endif
-
namespace subresource_filter {
ProfileInteractionManager::ProfileInteractionManager(
@@ -133,47 +126,6 @@ void ProfileInteractionManager::MaybeShowNotification() {
// currently primary.
DCHECK(page_);
DCHECK(page_->IsPrimary());
-
- const GURL& top_level_url = page_->GetMainDocument().GetLastCommittedURL();
- if (profile_context_->settings_manager()->ShouldShowUIForSite(
- top_level_url)) {
-#if BUILDFLAG(IS_ANDROID)
- if (messages::IsAdsBlockedMessagesUiEnabled() &&
- messages::MessageDispatcherBridge::Get()
- ->IsMessagesEnabledForEmbedder()) {
- subresource_filter::AdsBlockedMessageDelegate::CreateForWebContents(
- GetWebContents());
- ads_blocked_message_delegate_ =
- subresource_filter::AdsBlockedMessageDelegate::FromWebContents(
- GetWebContents());
- ads_blocked_message_delegate_->ShowMessage();
- } else {
- // NOTE: It is acceptable for the embedder to not have installed an
- // infobar manager.
- if (auto* infobar_manager =
- infobars::ContentInfoBarManager::FromWebContents(
- GetWebContents())) {
- subresource_filter::AdsBlockedInfobarDelegate::Create(infobar_manager);
- }
- }
-#endif
-
- // TODO(https://crbug.com/1103176): Plumb the actual frame reference here
- // (it comes from
- // ContentSubresourceFilterThrottleManager::DidDisallowFirstSubresource,
- // which comes from a specific frame).
- content_settings::PageSpecificContentSettings* content_settings =
- content_settings::PageSpecificContentSettings::GetForFrame(
- &page_->GetMainDocument());
- content_settings->OnContentBlocked(ContentSettingsType::ADS);
-
- ContentSubresourceFilterThrottleManager::LogAction(
- SubresourceFilterAction::kUIShown);
- profile_context_->settings_manager()->OnDidShowUI(top_level_url);
- } else {
- ContentSubresourceFilterThrottleManager::LogAction(
- SubresourceFilterAction::kUISuppressed);
- }
}
content::WebContents* ProfileInteractionManager::GetWebContents() {
--