Migrates theme patching to top-level ThemeSupport
This CL replaces all uses of self.UI.themeSupport with an instance
function from the top level theme_support directory. It also dupes in
some of the functionality from ui/utils to prevent a circular dependency
between ui/utils and theme_support.
Change-Id: Ib8efd06630b99ee23af04ecba0dbf3cc4b19c036
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352711
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/front_end/lighthouse/LighthouseReportRenderer.js b/front_end/lighthouse/LighthouseReportRenderer.js
index c6cab69..5d2d95f 100644
--- a/front_end/lighthouse/LighthouseReportRenderer.js
+++ b/front_end/lighthouse/LighthouseReportRenderer.js
@@ -10,6 +10,7 @@
import * as HostModule from '../host/host.js';
import * as Platform from '../platform/platform.js';
import * as SDK from '../sdk/sdk.js';
+import * as ThemeSupport from '../theme_support/theme_support.js';
import * as Timeline from '../timeline/timeline.js';
import * as UI from '../ui/ui.js';
import * as Workspace from '../workspace/workspace.js';
@@ -109,7 +110,7 @@
* @param {!Element} el
*/
static handleDarkMode(el) {
- if (self.UI.themeSupport.themeName() === 'dark') {
+ if (ThemeSupport.ThemeSupport.instance().themeName() === 'dark') {
el.classList.add('dark');
}
}