  // Handles rewriting view-source URLs for what we'll actually load.
  static bool HandleViewSource(GURL* url, BrowserContext* browser_context) {
    if (url->SchemeIs(kViewSourceScheme)) {
-@@ -98,6 +123,7 @@ BrowserURLHandlerImpl::BrowserURLHandler
+@@ -98,6 +116,7 @@ BrowserURLHandlerImpl::BrowserURLHandler
    // view-source: should take precedence over other rewriters, so it's
    // important to add it before calling up to the content client.
    AddHandlerPair(&HandleViewSource, &ReverseViewSource);

     {"enable-metrics",
      "Record metrics",
      "Record histograms and user actions.",
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -302,6 +302,8 @@
 #endif
 #include "services/service_manager/public/cpp/connector.h"
 
+#include "third_party/ungoogled/trknotify.h"
+
 using content::BrowserThread;
 
 namespace {
@@ -681,6 +683,8 @@ ChromeBrowserMainParts::ChromeBrowserMai
   // a ChromeNetworkDelegate attached that selectively allows cookies again.
   net::URLRequest::SetDefaultCookiePolicyToBlock();
 
+  net::URLRequest::SetTrkNotifier(&BrowserProcessImpl::RunTrkNotification);
+
   base::StatisticsRecorder::SetRecordChecker(
       std::make_unique<metrics::ExpiredHistogramsChecker>(
           chrome_metrics::kExpiredHistogramsHashes,
@@ -1008,6 +1012,8 @@ int ChromeBrowserMainParts::PreCreateThr
                                         base::CommandLine::ForCurrentProcess(),
                                         flags_ui::kAddSentinels);
   }
+  ungoogled::SetTrkBarVisibilityFromCommandLine(
+      base::CommandLine::ForCurrentProcess());
 #endif  // !defined(OS_CHROMEOS)
   // The MaterialDesignController needs to look at command line flags, which
   // are not available until this point. Now that they are, proceed with
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -781,6 +781,12 @@ const char kIconNtpName[] = "Large icons

 ChildProcessSecurityPolicyImpl::~ChildProcessSecurityPolicyImpl() {
--- /dev/null
+++ b/third_party/ungoogled/BUILD.gn
@@ -0,0 +1,36 @@
+# Provides low-level utilities
+source_set("util") {
+  sources = [
