mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 12:01:40 +08:00
We recently changed the behavior of DevTools such that it doesn't reload when the theme changes. However, during instantiation an extension receives the current theme name under chrome.devtools.panels.themeName. Given the above, when the theme changes, the themeName value is stale, and the extension has no way of knowing that the theme has changed. This CL introduces a new hook for extensions, setThemeChangeHandler, which follows the same pattern as setOpenResourceHandler. This allows an extension developer to register a callback for when the theme changes. The chrome.devtools.panels.themeName is automatically updated, and the callback also receives the theme name as its parameter. Bug: 1285420 Change-Id: I52aa813d7d7b327ad6bfe8ca99fa9d578662b417 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3380591 Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Paul Lewis <aerotwist@chromium.org>