commit | fbc07d538ce99850658d7d632703de123b1182ca | [log] [tgz] |
---|---|---|
author | Michael Cui <mlcui@google.com> | Mon Mar 03 01:04:01 2025 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Mar 03 01:04:01 2025 |
tree | 6716ae180021ce456903499b4ec8794d47f966a4 | |
parent | 5ed1ac2ecdd67c23ff9b30999cb39e1733d8cefe [diff] |
sunfish: Add best-effort `SunfishScannerFeatureWatcher` For upcoming changes (b/391909810) to update the shelf home button depending on whether Sunfish / Scanner UI can be shown, we would like a way of observing that. Unlike the launcher button, we cannot simply update the state when the launcher is shown, as the home button is continuously shown. Additionally, previous discussions in [1] mention that Sunfish and Scanner UI _should_ dynamically update when the "can show UI" state of the two features change. However, no such observer exists for these features. Observing the state which could affect the "can show UI" state of the two features requires a lot of different observations, and it is infeasible for all observers to implement these observations themselves. Introduce a BEST-EFFORT watcher class, `SunfishScannerFeatureWatcher`, which observes Sunfish and Scanner-related feature changes. Unfortunately, as discussed in b/397301161, it is infeasible to watch for all changes to the "show UI" states of these features, as Scanner's checks are very hard to observe. Additionally, Sunfish's enterprise policy is very difficult to observe (only in tests). As this class is BEST-EFFORT, no direct tests have been written. However, this CL introduces this watcher class to the launcher, so existing tests which test Launcher behaviour (`AppListControllerImplScannerEnabledTest`, `SunfishLauncherButtonTest`, `ScannerMetricsTest`) should still pass with this change, despite some of them using Sunfish's enterprise policy. [1]: https://crrev.com/c/6284627/comment/c339a676_242bcda6/ Bug: b:391909810, b:397301161 Change-Id: I6a6a210087991e127f8760e990c135709afca2df Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6297203 Reviewed-by: Xiaoqian Dai <xdai@chromium.org> Commit-Queue: Michael Cui <mlcui@google.com> Cr-Commit-Position: refs/heads/main@{#1426892}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.