[DevUI DFM] Add API and backend to install and load the DFM.
This CL adds DevUiModuleProvider classes (Java and C++) as backend to
install and load the DevUI DFM. The C++ API must be called from the UI
thread. It consists of query helpers:
* DevUiModuleProvider::GetInstance().ModuleInstalled(),
* DevUiModuleProvider::GetInstance().ModuleLoaded(),
and asynchronous (i.e., takes callbacks) actions:
* DevUiModuleProvider::GetInstance().InstallModule(),
* DevUiModuleProvider::GetInstance().LoadModule().
The Java backend handles DFM installation, and implements standard
on-demand DFM installation flow. For simplicity, no Java UI elements
(e.g., using Toast or InfoBar) as used. Instead, an interstitial page
that calls the C++ API will be used.
Some sources of complexity, also encountered by VrModuleProvider (upon
which the code is based) are:
* Interaction between C++ and Java DevUiModuleProvider via JNI calls
and interaction between the singletons.
* Queue management for InstallModule() and LoadModule(), to handle the
corner case of multiple concurrent install / load requests.
Bug: 927131
Change-Id: I4a6f3e4209857542a63e49ff79871a50bc5da4ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769170
Commit-Queue: Samuel Huang <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/master@{#692087}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index cd47411..a3560e87 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2941,6 +2941,14 @@
]
deps += [ "//chrome/browser/supervised_user/supervised_user_error_page" ]
}
+
+ if (dfmify_dev_ui) {
+ sources += [
+ "android/dev_ui/dev_ui_module_provider.cc",
+ "android/dev_ui/dev_ui_module_provider.h",
+ ]
+ deps += [ "//chrome/android/modules/dev_ui/provider:jni_headers" ]
+ }
} else { # !is_android
sources += [
"accessibility/invert_bubble_prefs.cc",