494 lines
23 KiB
Diff
494 lines
23 KiB
Diff
From: chromium-sdk <project_26591639_bot@noreply.gitlab.com>
|
|
Date: Fri, 14 Feb 2025 08:26:33 +0100
|
|
Subject: eyeo Browser Ad filtering Solution: Chrome Integration Module
|
|
|
|
Based on Chromium 133.0.6943.49
|
|
|
|
Pre-requisites: eyeo Browser Ad filtering Solution: Base Module
|
|
---
|
|
chrome/app/chrome_main_delegate.cc | 7 ++++-
|
|
chrome/browser/BUILD.gn | 7 +++++
|
|
chrome/browser/adblock/README.md | 3 ++
|
|
.../adblock_chrome_content_browser_client.cc | 27 ++++++++++++++++
|
|
.../adblock_chrome_content_browser_client.h | 31 +++++++++++++++++++
|
|
chrome/browser/chrome_browser_main.cc | 7 +++++
|
|
chrome/browser/preferences/BUILD.gn | 4 +++
|
|
.../prefs/chrome_pref_service_factory.cc | 11 +++++++
|
|
...hrome_browser_main_extra_parts_profiles.cc | 22 +++++++++++++
|
|
chrome/browser/resources/BUILD.gn | 5 +++
|
|
chrome/browser/ui/BUILD.gn | 10 ++++++
|
|
chrome/browser/ui/prefs/pref_watcher.cc | 13 ++++++++
|
|
chrome/browser/ui/tab_helpers.cc | 13 ++++++++
|
|
chrome/chrome_paks.gni | 5 +++
|
|
chrome/common/BUILD.gn | 3 ++
|
|
15 files changed, 167 insertions(+), 1 deletion(-)
|
|
create mode 100644 chrome/browser/adblock/README.md
|
|
create mode 100644 chrome/browser/adblock/adblock_chrome_content_browser_client.cc
|
|
create mode 100644 chrome/browser/adblock/adblock_chrome_content_browser_client.h
|
|
|
|
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
|
|
--- a/chrome/app/chrome_main_delegate.cc
|
|
+++ b/chrome/app/chrome_main_delegate.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2012 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/app/chrome_main_delegate.h"
|
|
|
|
@@ -38,6 +42,7 @@
|
|
#include "base/time/time.h"
|
|
#include "base/timer/timer.h"
|
|
#include "build/build_config.h"
|
|
+#include "chrome/browser/adblock/adblock_chrome_content_browser_client.h"
|
|
#include "chrome/browser/buildflags.h"
|
|
#include "chrome/browser/chrome_content_browser_client.h"
|
|
#include "chrome/browser/chrome_resource_bundle_helper.h"
|
|
@@ -1628,7 +1633,7 @@ content::ContentClient* ChromeMainDelegate::CreateContentClient() {
|
|
content::ContentBrowserClient*
|
|
ChromeMainDelegate::CreateContentBrowserClient() {
|
|
chrome_content_browser_client_ =
|
|
- std::make_unique<ChromeContentBrowserClient>();
|
|
+ std::make_unique<AdblockChromeContentBrowserClient>();
|
|
#if !BUILDFLAG(IS_ANDROID)
|
|
// Android does this in `ChromeMainDelegateAndroid::PreSandboxStartup`.
|
|
CHECK(sampling_profiler_);
|
|
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
|
--- a/chrome/browser/BUILD.gn
|
|
+++ b/chrome/browser/BUILD.gn
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2014 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//base/allocator/allocator.gni")
|
|
import("//build/buildflag_header.gni")
|
|
@@ -220,6 +223,8 @@ static_library("browser") {
|
|
"accessibility/page_colors_controller_factory.h",
|
|
"accessibility/prefers_default_scrollbar_styles_prefs.cc",
|
|
"accessibility/prefers_default_scrollbar_styles_prefs.h",
|
|
+ "adblock/adblock_chrome_content_browser_client.cc",
|
|
+ "adblock/adblock_chrome_content_browser_client.h",
|
|
"after_startup_task_utils.cc",
|
|
"after_startup_task_utils.h",
|
|
"bad_message.cc",
|
|
@@ -1837,6 +1842,7 @@ static_library("browser") {
|
|
"//chrome/installer/util:with_no_strings",
|
|
"//chrome/services/speech/buildflags",
|
|
"//components/account_settings",
|
|
+ "//components/adblock/content:browser",
|
|
"//components/application_locale_storage",
|
|
"//components/assist_ranker",
|
|
"//components/autofill/content/browser",
|
|
@@ -7676,6 +7682,7 @@ group("browser_public_dependencies") {
|
|
"//chrome/services/file_util/public/mojom",
|
|
"//components/accessibility_annotator/core",
|
|
"//components/account_id",
|
|
+ "//components/adblock/content:browser",
|
|
"//components/autofill/content/browser",
|
|
"//components/autofill/core/browser",
|
|
"//components/compose/core/browser:mojo_bindings",
|
|
diff --git a/chrome/browser/adblock/README.md b/chrome/browser/adblock/README.md
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/chrome/browser/adblock/README.md
|
|
@@ -0,0 +1,3 @@
|
|
+This folder contains the OS-agnostic, Chrome-specific source code of eyeo Chromium SDK.
|
|
+
|
|
+For the full documentation, refer to [components/adblock](/components/adblock).
|
|
diff --git a/chrome/browser/adblock/adblock_chrome_content_browser_client.cc b/chrome/browser/adblock/adblock_chrome_content_browser_client.cc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/chrome/browser/adblock/adblock_chrome_content_browser_client.cc
|
|
@@ -0,0 +1,27 @@
|
|
+/*
|
|
+ * This file is part of eyeo Chromium SDK,
|
|
+ * Copyright (C) 2006-present eyeo GmbH
|
|
+ *
|
|
+ * eyeo Chromium SDK is free software: you can redistribute it and/or modify
|
|
+ * it under the terms of the GNU General Public License version 3 as
|
|
+ * published by the Free Software Foundation.
|
|
+ *
|
|
+ * eyeo Chromium SDK is distributed in the hope that it will be useful,
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
+ * GNU General Public License for more details.
|
|
+ *
|
|
+ * You should have received a copy of the GNU General Public License
|
|
+ * along with eyeo Chromium SDK. If not, see <http://www.gnu.org/licenses/>.
|
|
+ */
|
|
+
|
|
+#include "chrome/browser/adblock/adblock_chrome_content_browser_client.h"
|
|
+
|
|
+#include "chrome/browser/profiles/profile.h"
|
|
+
|
|
+content::BrowserContext*
|
|
+AdblockChromeContentBrowserClient::GetBrowserContextForEyeoFactories(
|
|
+ content::BrowserContext* current_browser_context) {
|
|
+ return Profile::FromBrowserContext(current_browser_context)
|
|
+ ->GetOriginalProfile();
|
|
+}
|
|
diff --git a/chrome/browser/adblock/adblock_chrome_content_browser_client.h b/chrome/browser/adblock/adblock_chrome_content_browser_client.h
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/chrome/browser/adblock/adblock_chrome_content_browser_client.h
|
|
@@ -0,0 +1,31 @@
|
|
+/*
|
|
+ * This file is part of eyeo Chromium SDK,
|
|
+ * Copyright (C) 2006-present eyeo GmbH
|
|
+ *
|
|
+ * eyeo Chromium SDK is free software: you can redistribute it and/or modify
|
|
+ * it under the terms of the GNU General Public License version 3 as
|
|
+ * published by the Free Software Foundation.
|
|
+ *
|
|
+ * eyeo Chromium SDK is distributed in the hope that it will be useful,
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
+ * GNU General Public License for more details.
|
|
+ *
|
|
+ * You should have received a copy of the GNU General Public License
|
|
+ * along with eyeo Chromium SDK. If not, see <http://www.gnu.org/licenses/>.
|
|
+ */
|
|
+
|
|
+#ifndef CHROME_BROWSER_ADBLOCK_ADBLOCK_CHROME_CONTENT_BROWSER_CLIENT_H_
|
|
+#define CHROME_BROWSER_ADBLOCK_ADBLOCK_CHROME_CONTENT_BROWSER_CLIENT_H_
|
|
+
|
|
+#include "chrome/browser/chrome_content_browser_client.h"
|
|
+#include "components/adblock/content/browser/adblock_content_browser_client.h"
|
|
+
|
|
+class AdblockChromeContentBrowserClient
|
|
+ : public adblock::AdblockContentBrowserClient<ChromeContentBrowserClient> {
|
|
+ private:
|
|
+ content::BrowserContext* GetBrowserContextForEyeoFactories(
|
|
+ content::BrowserContext* current_browser_context) override;
|
|
+};
|
|
+
|
|
+#endif // CHROME_BROWSER_ADBLOCK_ADBLOCK_CHROME_CONTENT_BROWSER_CLIENT_H_
|
|
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
|
|
--- a/chrome/browser/chrome_browser_main.cc
|
|
+++ b/chrome/browser/chrome_browser_main.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2012 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/browser/chrome_browser_main.h"
|
|
|
|
@@ -94,6 +98,7 @@
|
|
#include "chrome/grit/branded_strings.h"
|
|
#include "chrome/grit/generated_resources.h"
|
|
#include "chrome/installer/util/google_update_settings.h"
|
|
+#include "components/adblock/content/browser/adblock_web_ui_controller_factory.h"
|
|
#include "components/color/color_mixers.h"
|
|
#include "components/device_event_log/device_event_log.h"
|
|
#include "components/embedder_support/origin_trials/component_updater_utils.h"
|
|
@@ -1870,6 +1875,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
|
// called inside PostProfileInit.
|
|
content::WebUIControllerFactory::RegisterFactory(
|
|
ChromeWebUIControllerFactory::GetInstance());
|
|
+ content::WebUIControllerFactory::RegisterFactory(
|
|
+ adblock::AdblockWebUIControllerFactory::GetInstance());
|
|
RegisterChromeWebUIConfigs();
|
|
RegisterChromeUntrustedWebUIConfigs();
|
|
|
|
diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BUILD.gn
|
|
--- a/chrome/browser/preferences/BUILD.gn
|
|
+++ b/chrome/browser/preferences/BUILD.gn
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2019 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//build/config/android/rules.gni")
|
|
import("//third_party/jni_zero/jni_zero.gni")
|
|
@@ -57,6 +60,7 @@ java_cpp_strings("java_pref_names_srcjar") {
|
|
"//chrome/browser/enterprise/reporting/prefs.cc",
|
|
"//chrome/browser/ui/safety_hub/safety_hub_prefs.h",
|
|
"//chrome/common/pref_names.h",
|
|
+ "//components/adblock/core/common/adblock_prefs.cc",
|
|
"//components/autofill/core/common/autofill_prefs.h",
|
|
"//components/bookmarks/common/bookmark_pref_names.h",
|
|
"//components/commerce/core/pref_names.h",
|
|
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
|
|
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
|
|
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2012 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/browser/prefs/chrome_pref_service_factory.h"
|
|
|
|
@@ -43,6 +47,7 @@
|
|
#include "chrome/grit/branded_strings.h"
|
|
#include "chrome/grit/browser_resources.h"
|
|
#include "chrome/grit/generated_resources.h"
|
|
+#include "components/adblock/core/common/adblock_prefs.h"
|
|
#include "components/component_updater/pref_names.h"
|
|
#include "components/policy/core/browser/configuration_policy_pref_store.h"
|
|
#include "components/pref_registry/pref_registry_syncable.h"
|
|
@@ -197,6 +202,12 @@ const auto kTrackedPrefs = std::to_array<prefs::TrackedPreferenceMetadata>({
|
|
EnforcementLevel::ENFORCE_ON_LOAD, PrefTrackingStrategy::ATOMIC,
|
|
ValueType::IMPERSONAL},
|
|
#endif
|
|
+ {100, adblock::common::prefs::kSubscriptionSignatures,
|
|
+ EnforcementLevel::ENFORCE_ON_LOAD, PrefTrackingStrategy::SPLIT,
|
|
+ ValueType::IMPERSONAL},
|
|
+ {101, adblock::common::prefs::kLastUsedSchemaVersion,
|
|
+ EnforcementLevel::ENFORCE_ON_LOAD, PrefTrackingStrategy::ATOMIC,
|
|
+ ValueType::IMPERSONAL}
|
|
|
|
// See note at top, new items added here also need to be added to
|
|
// histograms.xml's TrackedPreference enum.
|
|
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
+++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2013 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
|
|
|
|
@@ -274,6 +278,15 @@
|
|
#include "chrome/browser/webid/federated_identity_permission_context_factory.h"
|
|
#include "chrome/common/buildflags.h"
|
|
#include "chrome/common/chrome_features.h"
|
|
+#include "components/adblock/content/browser/factories/adblock_request_throttle_factory.h"
|
|
+#include "components/adblock/content/browser/factories/adblock_telemetry_service_factory.h"
|
|
+#include "components/adblock/content/browser/factories/content_security_policy_injector_factory.h"
|
|
+#include "components/adblock/content/browser/factories/element_hider_factory.h"
|
|
+#include "components/adblock/content/browser/factories/resource_classification_runner_factory.h"
|
|
+#include "components/adblock/content/browser/factories/session_stats_factory.h"
|
|
+#include "components/adblock/content/browser/factories/sitekey_storage_factory.h"
|
|
+#include "components/adblock/content/browser/factories/subscription_persistent_metadata_factory.h"
|
|
+#include "components/adblock/content/browser/factories/subscription_service_factory.h"
|
|
#include "components/autofill/content/browser/autofill_log_router_factory.h"
|
|
#include "components/breadcrumbs/core/breadcrumbs_status.h"
|
|
#include "components/captive_portal/core/buildflags.h"
|
|
@@ -985,6 +998,15 @@ void ChromeBrowserMainExtraPartsProfiles::
|
|
FederatedIdentityApiPermissionContextFactory::GetInstance();
|
|
FederatedIdentityAutoReauthnPermissionContextFactory::GetInstance();
|
|
FederatedIdentityPermissionContextFactory::GetInstance();
|
|
+ adblock::AdblockTelemetryServiceFactory::GetInstance();
|
|
+ adblock::AdblockRequestThrottleFactory::GetInstance();
|
|
+ adblock::ContentSecurityPolicyInjectorFactory::GetInstance();
|
|
+ adblock::ElementHiderFactory::GetInstance();
|
|
+ adblock::ResourceClassificationRunnerFactory::GetInstance();
|
|
+ adblock::SessionStatsFactory::GetInstance();
|
|
+ adblock::SitekeyStorageFactory::GetInstance();
|
|
+ adblock::SubscriptionPersistentMetadataFactory::GetInstance();
|
|
+ adblock::SubscriptionServiceFactory::GetInstance();
|
|
#if BUILDFLAG(IS_ANDROID)
|
|
feed::FeedServiceFactory::GetInstance();
|
|
#endif
|
|
diff --git a/chrome/browser/resources/BUILD.gn b/chrome/browser/resources/BUILD.gn
|
|
--- a/chrome/browser/resources/BUILD.gn
|
|
+++ b/chrome/browser/resources/BUILD.gn
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2014 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//chrome/browser/buildflags.gni")
|
|
import("//chrome/common/features.gni")
|
|
@@ -311,6 +314,7 @@ group("dev_ui_resources") {
|
|
"predictors:resources",
|
|
"privacy_sandbox/internals:resources",
|
|
"usb_internals:resources",
|
|
+ "//components/adblock/content/resources/adblock_internals:resources",
|
|
"//components/commerce/core/internals/resources",
|
|
"//components/data_sharing/data_sharing_internals/resources",
|
|
"//components/download/resources/download_internals:resources",
|
|
@@ -387,6 +391,7 @@ repack("dev_ui_paks") {
|
|
"$root_gen_dir/chrome/predictors_resources.pak",
|
|
"$root_gen_dir/chrome/privacy_sandbox_internals_resources.pak",
|
|
"$root_gen_dir/chrome/usb_internals_resources.pak",
|
|
+ "$root_gen_dir/components/adblock_internals_resources.pak",
|
|
"$root_gen_dir/components/commerce_internals_resources.pak",
|
|
"$root_gen_dir/components/data_sharing_internals_resources.pak",
|
|
"$root_gen_dir/components/dev_ui_components_resources.pak",
|
|
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
|
|
--- a/chrome/browser/ui/BUILD.gn
|
|
+++ b/chrome/browser/ui/BUILD.gn
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2014 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//build/config/buildflags_paint_preview.gni")
|
|
import("//build/config/compiler/compiler.gni")
|
|
@@ -446,6 +449,7 @@ static_library("ui") {
|
|
"//chrome/installer/util:with_no_strings",
|
|
"//components/access_code_cast/common:metrics",
|
|
"//components/account_id",
|
|
+ "//components/adblock/content:browser",
|
|
"//components/affiliations/core/browser:affiliations",
|
|
"//components/autofill/content/browser",
|
|
"//components/autofill/content/browser:risk_proto",
|
|
@@ -1085,6 +1089,12 @@ static_library("ui") {
|
|
"//extensions/browser:extension_action_enums",
|
|
]
|
|
}
|
|
+ ### Android API module start
|
|
+ deps += [
|
|
+ "//components/adblock/android:java_bindings",
|
|
+ "//components/adblock/android:jni_headers",
|
|
+ ]
|
|
+ ### Android API module end
|
|
} else {
|
|
# !is_android
|
|
sources += [
|
|
diff --git a/chrome/browser/ui/prefs/pref_watcher.cc b/chrome/browser/ui/prefs/pref_watcher.cc
|
|
--- a/chrome/browser/ui/prefs/pref_watcher.cc
|
|
+++ b/chrome/browser/ui/prefs/pref_watcher.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2018 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/browser/ui/prefs/pref_watcher.h"
|
|
|
|
@@ -19,6 +23,7 @@
|
|
#include "chrome/browser/renderer_preferences_util.h"
|
|
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
|
|
#include "chrome/common/pref_names.h"
|
|
+#include "components/adblock/core/common/adblock_prefs.h"
|
|
#include "components/keyed_service/core/keyed_service.h"
|
|
#include "components/language/core/browser/pref_names.h"
|
|
#include "components/live_caption/pref_names.h"
|
|
@@ -87,6 +92,14 @@ const char* const kWebPrefsToObserve[] = {
|
|
prefs::kAccessibilityFocusHighlightEnabled,
|
|
#endif
|
|
prefs::kPageColorsBlockList,
|
|
+
|
|
+ adblock::common::prefs::kAdblockAllowedDomainsLegacy,
|
|
+ adblock::common::prefs::kAdblockCustomFiltersLegacy,
|
|
+ adblock::common::prefs::kAdblockCustomSubscriptionsLegacy,
|
|
+ adblock::common::prefs::kAdblockSubscriptionsLegacy,
|
|
+ adblock::common::prefs::kEnableAcceptableAdsLegacy,
|
|
+ adblock::common::prefs::kEnableAdblockLegacy,
|
|
+
|
|
};
|
|
|
|
} // namespace
|
|
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc
|
|
--- a/chrome/browser/ui/tab_helpers.cc
|
|
+++ b/chrome/browser/ui/tab_helpers.cc
|
|
@@ -1,6 +1,10 @@
|
|
// Copyright 2014 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
+//
|
|
+// This source code is a part of eyeo Chromium SDK.
|
|
+// Use of this source code is governed by the GPLv3 that can be found in the
|
|
+// components/adblock/LICENSE file.
|
|
|
|
#include "chrome/browser/ui/tab_helpers.h"
|
|
|
|
@@ -107,6 +111,8 @@
|
|
#include "chrome/common/chrome_features.h"
|
|
#include "chrome/common/chrome_isolated_world_ids.h"
|
|
#include "chrome/common/chrome_switches.h"
|
|
+#include "components/adblock/content/browser/adblock_webcontents_observer.h"
|
|
+#include "components/adblock/content/browser/factories/embedding_utils.h"
|
|
#include "components/blocked_content/popup_blocker_tab_helper.h"
|
|
#include "components/blocked_content/popup_opener_tab_helper.h"
|
|
#include "components/breadcrumbs/core/breadcrumbs_status.h"
|
|
@@ -355,6 +361,12 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
|
optimization_guide_decider);
|
|
}
|
|
}
|
|
+
|
|
+ auto* original_profile = profile->GetOriginalProfile();
|
|
+ adblock::EnsureBackgroundServicesStarted(original_profile);
|
|
+ adblock::RegisterAdblockWebContentObserver<
|
|
+ adblock::AdblockWebContentObserver>(web_contents, original_profile);
|
|
+
|
|
autofill::AutofillClientProvider& autofill_client_provider =
|
|
autofill::AutofillClientProviderFactory::GetForProfile(profile);
|
|
autofill_client_provider.CreateClientForWebContents(web_contents);
|
|
@@ -383,6 +395,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
|
// completions.
|
|
HttpAuthCacheStatus::HttpAuthCacheStatus::CreateForWebContents(web_contents);
|
|
#endif // BUILDFLAG(IS_ANDROID)
|
|
+
|
|
if (breadcrumbs::IsEnabled(g_browser_process->local_state())) {
|
|
BreadcrumbManagerTabHelper::CreateForWebContents(web_contents);
|
|
}
|
|
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni
|
|
--- a/chrome/chrome_paks.gni
|
|
+++ b/chrome/chrome_paks.gni
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2016 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//ash/ambient/resources/resources.gni")
|
|
import("//build/config/chrome_build.gni")
|
|
@@ -129,6 +132,7 @@ template("chrome_extra_paks") {
|
|
"$root_gen_dir/chrome/glic_shared_resources.pak",
|
|
"$root_gen_dir/chrome/saved_tab_groups_unsupported_resources.pak",
|
|
"$root_gen_dir/chrome/segmentation_internals_resources.pak",
|
|
+ "$root_gen_dir/components/adblock/core/resources/adblock_resources.pak",
|
|
"$root_gen_dir/components/autofill/core/browser/geo/autofill_address_rewriter_resources.pak",
|
|
"$root_gen_dir/components/autofill/core/browser/geo/autofill_alternative_state_name_map_resources.pak",
|
|
"$root_gen_dir/components/autofill_and_password_manager_internals_resources.pak",
|
|
@@ -174,6 +178,7 @@ template("chrome_extra_paks") {
|
|
"//chrome/browser/resources/glic/shared:resources",
|
|
"//chrome/browser/resources/saved_tab_groups_unsupported:resources",
|
|
"//chrome/common:resources",
|
|
+ "//components/adblock/core/resources:adblock_resources",
|
|
"//components/autofill/core/browser:autofill_address_rewriter_resources",
|
|
"//components/autofill/core/browser:autofill_alternative_state_name_map_resources",
|
|
"//components/enterprise/connectors/resources",
|
|
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
|
|
--- a/chrome/common/BUILD.gn
|
|
+++ b/chrome/common/BUILD.gn
|
|
@@ -1,6 +1,9 @@
|
|
# Copyright 2014 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
+#
|
|
+# This source code is a part of eyeo Chromium SDK.
|
|
+# Use of this source code is governed by the GPLv3 that can be found in the components/adblock/LICENSE file.
|
|
|
|
import("//build/buildflag_header.gni")
|
|
import("//build/config/chrome_build.gni")
|
|
--
|