[views-ax] Cleanup of GetTooltipText (part 2) This CL cleans up the last bits of the refactor to make Views cache their tooltip text. * Rename GetCachedTooltipText and SetCachedTooltipText to just Get/SetTooltipText. - This involved some renaming in some Views that had a method named the same to set a custom tooltip text. That method on those Views was then renamed to make clearer that it was "custom". - Some Views also had some custom logic in their SetTooltipText and so this CL handled those by adding a PropertyChangedCallback with that logic that would run on those Views when the tooltip property changed. * Rename GetTooltipText(Point) to GetRenderedTooltipText(Point) - This is the method that the tooltip controller uses to expose the tooltip, and in most cases this and GetTooltipText() return the same string, but there are some Views such as TableView and MenuItemView that require a Point to calculate the tooltip text. * This CL also includes the small refactor of a couple of Views for which their tooltip text had not been refactored. These were small refactors, one just needed a callback and the other just had to call SetTooltipText. * For the Views that had their own custom logic in a local `SetTooltipText`, this CL moves that custom logic to an override of a function in view that will run when the tooltip text changes. This is needed in many cases over adding a property callback because these Views used the value of the tooltip text BEFORE it changes, which was not possible to get via the property callback. *`Label` had a local `SetTooltipText` that set a local custom tooltip variable. To accommodate this along with the new method of the same name in View, we renamed the Label version to SetCustomTooltip text, which also fits the behavior better. * More information can be found on the linked bug, but TLDR is that Views now cache their tooltip text. This CL then renames and cleans up a bit to finish up the refactor. `View::GetTooltipText()` returns this cached tooltip for all Views. `View::GetRenderedTooltipText(point)` exists so Views that require of a point to compute their tooltip can override this method to do so. The base version of this method will simply return the cached member. `GetRenderedTooltipText` is the method that is used by the tooltip manager. This CL is part of the ViewsAX project: https://docs.google.com/document/d/1Ku7HOyDsiZem1yaV6ccZ-tz3lO2XR2NEcm8HjR6d-VY/edit#heading=h.ke1u3utej413 Bug: 325137417, 378724151 Change-Id: Id24bab7877bdb89b5bf4b8c42c3c8ba148889268 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6093662 Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Elly FJ <ellyjones@chromium.org> Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com> Commit-Queue: Javier Contreras <javiercon@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1409190}
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.