fune/browser/components/urlbar
Drew Willcoxon a3b0a1fd4c Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak
This removes `UrlbarProvider.pickResult()` and `blockResult()` in favor of
handling picks and dismissals through `onEngagement()`. A number of providers
use those two methods, so this revision touches a lot of files.

Handling dismissals through `onEngagement()` means `UrlbarInput.pickResult()`
can no longer tell whether a result is successfully dismissed, so it can't
remove the result anymore. (Maybe `onEngagement()` could return some value
indicating it dismissed the result, but I don't want to go down that road.)
Instead, I split `UrlbarController.handleDeleteEntry()` into two methods: a
public one that removes the result and notifies listeners, and a private one
that handles dismissing the selected result internally in
UrlbarController. Providers that have dismissable results should now implement
`onEngagement()` and call `controller.removeResult()`.

I made some other improvements to engagement handling. There's still room for
more but this patch is big enough already.

Other notable changes:

Include the engaged result in engagement notifications so providers have easy
access to it and can respond to clicks and dismissals more easily. That also
lets us stop passing `selIndex` and `provider` to `engagementEvent.record()`
since now it can compute those from the passed-in result.

Add the concept of `isSessionOngoing` to engagement notifications so providers
can tell whether an engagement ended the search session. Right now, providers
like quick suggest that record a bunch of provider-specific legacy telemetry
assume that `onEngagement()` ends the session, but that's no longer true.

Unify result buttons and result menu commands by setting
`element.dataset.command` on buttons (hopefully we can remove buttons soon, at
least the ones that aren't tip buttons)

Make sure we always notify providers on engagement even on dismissals or
when skipping legacy telemetry

Move dismissal of restyled search suggestions and history results from
`UrlbarController.handleDeleteEntry()` to the Places provider

Move dismissal of form history results from
`UrlbarController.handleDeleteEntry()` to the search suggestions provider

In the Places provider, remove the unused `_addSearchEngineMatch()` method. Also
remove the code in the "searchengine" case that creates a non-search-history
result. This code is unreached because the only time the provider creates a
"searchengine" match it also sets `isSearchHistory` to true.

In `UrlbarTestUtils.promiseAutocompleteResultPopup()`, change the default value
of the `fireInputEvent` param from false to true. This is necessary because
without a starting input event, the start event info in `engagementEvent` will
be null, so when `engagementEvent.record()` is called at the end of the
engagement, it will bail, and providers will not be notified of the engagement.
IMO true is a better default value anyway because input events will typically be
fired when the user performs a search.

Differential Revision: https://phabricator.services.mozilla.com/D174941
2023-04-13 06:03:33 +00:00
..
content Bug 1822388 - Move brandings.ftl from browser to toolkit, r=eemeli,settings-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,sgalich,Mardak 2023-03-15 17:00:48 +00:00
docs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
private Bug 1823831 - When a VPN is active, don't fetch the weather suggestion, and re-fetch when it's disconnected. r=daisuke 2023-03-22 17:31:28 +00:00
tests Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
unitconverters
.eslintrc.js Bug 1824173 - Enable ESLint configuration valid-jsdocs across the tree, disabling for currently failing locations. r=mossop,webcompat-reviewers,extension-reviewers,credential-management-reviewers,denschub,dimi,robwu 2023-03-24 19:35:25 +00:00
jar.mn
MerinoClient.sys.mjs
metrics.yaml Backed out changeset c53de63f9b5f (bug 1824253) landed a bit ahead of schedule CLOSED TREE 2023-04-05 13:48:20 -04:00
moz.build
QuickActionsLoaderDefault.sys.mjs Bug 1801019 - Add telemetry for screenshots component. r=sfoster 2023-02-25 17:26:34 +00:00
QuickSuggest.sys.mjs Bug 1788954 - Convert toolkit/components/nimbus to ES modules r=Standard8,pip-reviewers,credential-management-reviewers,sgalich 2023-03-30 20:51:58 +00:00
UrlbarController.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarEventBufferer.sys.mjs
UrlbarInput.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarMuxerUnifiedComplete.sys.mjs Bug 1820453: Introduce unsortedResults to the query r=adw 2023-03-08 02:30:33 +00:00
UrlbarPrefs.sys.mjs Backed out changeset c53de63f9b5f (bug 1824253) landed a bit ahead of schedule CLOSED TREE 2023-04-05 13:48:20 -04:00
UrlbarProviderAboutPages.sys.mjs
UrlbarProviderAliasEngines.sys.mjs
UrlbarProviderAutofill.sys.mjs Bug 1821106 - SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming r=Standard8 2023-03-31 20:27:18 +00:00
UrlbarProviderBookmarkKeywords.sys.mjs
UrlbarProviderCalculator.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderContextualSearch.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderExtension.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderHeuristicFallback.sys.mjs
UrlbarProviderHistoryUrlHeuristic.sys.mjs
UrlbarProviderInputHistory.sys.mjs
UrlbarProviderInterventions.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderOmnibox.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderOpenTabs.sys.mjs
UrlbarProviderPlaces.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderPreloadedSites.sys.mjs
UrlbarProviderPrivateSearch.sys.mjs
UrlbarProviderQuickActions.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderQuickSuggest.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderRemoteTabs.sys.mjs Bug 1814931 - Convert services/sync imports to direct ES imports. r=markh,settings-reviewers,credential-management-reviewers,mconley,dimi 2023-02-13 11:44:29 +00:00
UrlbarProviderSearchSuggestions.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderSearchTips.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProvidersManager.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderTabToSearch.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderTokenAliasEngines.sys.mjs
UrlbarProviderTopSites.sys.mjs
UrlbarProviderUnitConversion.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarProviderWeather.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarResult.sys.mjs Bug 1823278 - Update consumers of toolkit/components/utils to import ES modules directly. r=Standard8 2023-03-22 02:02:51 +00:00
UrlbarSearchOneOffs.sys.mjs
UrlbarSearchUtils.sys.mjs Bug 1821106 - SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming r=Standard8 2023-03-31 20:27:18 +00:00
UrlbarTokenizer.sys.mjs
UrlbarUtils.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
UrlbarValueFormatter.sys.mjs
UrlbarView.sys.mjs Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00