From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 9 Feb 2022 10:55:54 +0100
Subject: fix: expose globals to allow patching Devtools dock

Electron calls into UI.DockController.instance().setDockSide(side) in
order to allow users to set the devtools dock position via
webContents.openDevTools({ mode }). In https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310870
the globals which we used to enable this were removed, and so we need to
re-expose them to fix this broken functionality. We should look to
upstream a more durable approach to allowing us to do this, at which
point this patch can be removed.

diff --git a/front_end/entrypoints/shell/BUILD.gn b/front_end/entrypoints/shell/BUILD.gn
index 72617d7036162ab3ab86c85df3f81b6e5a8c685d..aab471b56d785b372e5aa9aaddc792584700d16e 100644
--- a/front_end/entrypoints/shell/BUILD.gn
+++ b/front_end/entrypoints/shell/BUILD.gn
@@ -30,6 +30,7 @@ devtools_entrypoint("shell") {
     "../../ui/legacy/components/perf_ui:meta",
     "../../ui/legacy/components/quick_open:meta",
     "../../ui/legacy/components/source_frame:meta",
+    "../../ui/legacy:legacy",
   ]
 
   visibility = [
diff --git a/front_end/entrypoints/shell/shell.ts b/front_end/entrypoints/shell/shell.ts
index b22591ee606ef449817aef1f9bd5ff0c024d1c05..a14c0e0a381ae838d44d4c7f2cc252c24380b602 100644
--- a/front_end/entrypoints/shell/shell.ts
+++ b/front_end/entrypoints/shell/shell.ts
@@ -18,6 +18,7 @@ import '../../models/logs/logs-meta.js';
 import '../main/main-meta.js';
 import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
 import '../../ui/legacy/components/quick_open/quick_open-meta.js';
+import '../../ui/legacy/legacy-legacy.js';
 import '../../core/sdk/sdk-meta.js';
 import '../../ui/legacy/components/source_frame/source_frame-meta.js';
 import '../../panels/console_counters/console_counters-meta.js';
diff --git a/front_end/ui/legacy/BUILD.gn b/front_end/ui/legacy/BUILD.gn
index c0ff2a3161a654589c90077e2c1d50cfa8a0aba0..1e1204d315736c44d2299aeb33052e735efc08fa 100644
--- a/front_end/ui/legacy/BUILD.gn
+++ b/front_end/ui/legacy/BUILD.gn
@@ -185,5 +185,6 @@ devtools_entrypoint("legacy") {
   visibility = [
     "../..:legacy_entrypoints",
     "../../legacy_test_runner/*",
+    "../../entrypoints/shell/*",
   ]
 }
