Migrate inspector_main/ to ESM internally

Bug: 1006759
Change-Id: Icd034e732459683a12f6df9383ee704a83ab36c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994966
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/front_end/inspector_main/InspectorMain.js b/front_end/inspector_main/InspectorMain.js
index 921674c..020c96b 100644
--- a/front_end/inspector_main/InspectorMain.js
+++ b/front_end/inspector_main/InspectorMain.js
@@ -37,7 +37,7 @@
     }, Components.TargetDetachedDialog.webSocketConnectionLost);
 
     new SourcesPanelIndicator();
-    new InspectorMain.BackendSettingsSync();
+    new BackendSettingsSync();
     new MobileThrottling.NetworkPanelIndicator();
 
     Host.InspectorFrontendHost.events.addEventListener(
@@ -204,39 +204,3 @@
 }
 
 SDK.ChildTargetManager.install();
-
-/* Legacy exported object */
-self.InspectorMain = self.InspectorMain || {};
-
-/* Legacy exported object */
-InspectorMain = InspectorMain || {};
-
-/**
- * @constructor
- */
-InspectorMain.InspectorMain = InspectorMainImpl;
-
-/**
- * @constructor
- */
-InspectorMain.ReloadActionDelegate = ReloadActionDelegate;
-
-/**
- * @constructor
- */
-InspectorMain.FocusDebuggeeActionDelegate = FocusDebuggeeActionDelegate;
-
-/**
- * @constructor
- */
-InspectorMain.NodeIndicator = NodeIndicator;
-
-/**
- * @constructor
- */
-InspectorMain.SourcesPanelIndicator = SourcesPanelIndicator;
-
-/**
- * @constructor
- */
-InspectorMain.BackendSettingsSync = BackendSettingsSync;
diff --git a/front_end/inspector_main/RenderingOptions.js b/front_end/inspector_main/RenderingOptions.js
index 0c3d111..185e2e8 100644
--- a/front_end/inspector_main/RenderingOptions.js
+++ b/front_end/inspector_main/RenderingOptions.js
@@ -94,14 +94,3 @@
     }
   }
 }
-
-/* Legacy exported object */
-self.InspectorMain = self.InspectorMain || {};
-
-/* Legacy exported object */
-InspectorMain = InspectorMain || {};
-
-/**
- * @constructor
- */
-InspectorMain.RenderingOptionsView = RenderingOptionsView;
diff --git a/front_end/inspector_main/inspector_main-legacy.js b/front_end/inspector_main/inspector_main-legacy.js
new file mode 100644
index 0000000..35be6a6
--- /dev/null
+++ b/front_end/inspector_main/inspector_main-legacy.js
@@ -0,0 +1,43 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import * as InspectorMainModule from './inspector_main.js';
+
+self.InspectorMain = self.InspectorMain || {};
+InspectorMain = InspectorMain || {};
+
+/**
+ * @constructor
+ */
+InspectorMain.InspectorMain = InspectorMainModule.InspectorMain.InspectorMainImpl;
+
+/**
+ * @constructor
+ */
+InspectorMain.ReloadActionDelegate = InspectorMainModule.InspectorMain.ReloadActionDelegate;
+
+/**
+ * @constructor
+ */
+InspectorMain.FocusDebuggeeActionDelegate = InspectorMainModule.InspectorMain.FocusDebuggeeActionDelegate;
+
+/**
+ * @constructor
+ */
+InspectorMain.NodeIndicator = InspectorMainModule.InspectorMain.NodeIndicator;
+
+/**
+ * @constructor
+ */
+InspectorMain.SourcesPanelIndicator = InspectorMainModule.InspectorMain.SourcesPanelIndicator;
+
+/**
+ * @constructor
+ */
+InspectorMain.BackendSettingsSync = InspectorMainModule.InspectorMain.BackendSettingsSync;
+
+/**
+ * @constructor
+ */
+InspectorMain.RenderingOptionsView = InspectorMainModule.RenderingOptions.RenderingOptionsView;
diff --git a/front_end/inspector_main/module.json b/front_end/inspector_main/module.json
index 019889a..069499f 100644
--- a/front_end/inspector_main/module.json
+++ b/front_end/inspector_main/module.json
@@ -136,6 +136,7 @@
     "scripts": [],
     "modules": [
         "inspector_main.js",
+        "inspector_main-legacy.js",
         "RenderingOptions.js",
         "InspectorMain.js"
     ],