Files
tubestation/toolkit/components/satchel/components.conf
Dimi b987c90555 Bug 1887007 - P1. Move formautofill autocomplete seach logic from AutofillProfileAutoComplete to AutoCompleteChild r=credential-management-reviewers,sgalich
This commit makes two significant changes:

1. Refactors AutofillProfileAutoComplete Logic to AutoCompleteChild:

Migrates logic from AutofillProfileAutoComplete to AutoCompleteChild,
transitioning state management from a per-process to a per-frame basis.
This lays the groundwork for future support of autofill functionality
across iframes.

2. Implements the Concept of "Autocomplete Entry Providers":

Introduces a framework for autocomplete providers (e.g., FormAutofill, LoginManager, FormHistory)
to integrate with the autocomplete system through a set of APIs, including:
JSWindowActorChild:
  - string actorName()
  - bool shouldSearchForAutoComplete(element);
  - jsval getAutoCompleteSearchOption(element);
  - jsval recordToAutoCompleteResult(searchString, element, record);
JSWindowActorParent:
  - searchAutoCompleteEntries(searchString, options)

Besides implement the above API, autocomplete provider must use `markAsAutoCompletableField` in
AutoCompleteChild to register fields for autocomplete, enabling the FormFillController to
initiate autocomplete searches when users click on the input field.

Note: This patch only integrates FormAutofill, integrating FormHistory and
LoginManager will be in other patches.

Differential Revision: https://phabricator.services.mozilla.com/D205444
2024-04-15 15:48:47 +00:00

34 lines
1.4 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Classes = [
{
'cid': '{895db6c7-dbdf-40ea-9f64-b175033243dc}',
'contract_ids': [
'@mozilla.org/satchel/form-fill-controller;1',
'@mozilla.org/autocomplete/search;1?name=form-fill-controller',
],
'type': 'nsFormFillController',
'constructor': 'nsFormFillController::GetSingleton',
'headers': ['/toolkit/components/satchel/nsFormFillController.h'],
'categories': {'app-startup': 'FormFillController'},
},
{
'cid': '{23530265-31d1-4ee9-864c-c081975fb7bc}',
'contract_ids': ['@mozilla.org/satchel/form-history-autocomplete;1'],
'esModule': 'resource://gre/modules/FormHistoryAutoComplete.sys.mjs',
'constructor': 'FormHistoryAutoComplete',
},
{
'cid': '{3a0012eb-007f-4bb8-aa81-a07385f77a25}',
'contract_ids': ['@mozilla.org/satchel/form-history-startup;1'],
'esModule': 'resource://gre/modules/FormHistoryStartup.sys.mjs',
'constructor': 'FormHistoryStartup',
'categories': {'profile-after-change': 'formHistoryStartup'},
},
]