commit | ca6ce1e43d27c37c95908e785ce7e4070b5bbe90 | [log] [tgz] |
---|---|---|
author | Henrique Ferreiro <hferreiro@igalia.com> | Tue Apr 25 16:25:28 2023 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Apr 25 16:25:28 2023 |
tree | ea06b37e7901c78a1e3130ecd77d52d2270c6423 | |
parent | d7d9590395dbe03de4aba2ee73e6a898a7d21d1d [diff] |
Make sure ResourceBundle is always initialized Many code relies on having access to the resource scale factors, in particular, code to retrieve the maximum supported resource scale factor: `ui::GetSupportedResourceScaleFactors().back()`. This CL ensures that they are always available by adding more CHECKs and initializing `ui::ResourceBundle` where that was missing. Also, add `ui::GetMaxSupportedResourceScaleFactor` to replace the aforementioned pattern making it more explicit and allowing to hit those CHECKs. Lastly, optimize `GetSupportedResourceScaleFactor(scale)` to return early once we find a resource scale factor that isn't closer to `scale`, since the list is sorted. Bug: 1434785 Change-Id: I1a2d90d478332fd1f517e5e51680361c97d5d2e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4401946 Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com> Cr-Commit-Position: refs/heads/main@{#1135249}
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.