forked from mirrors/gecko-dev
Currently, when users autocomplete a field for an address, credit card, or login, Firefox also "autofills" the relevant fields. Here is a quick summary of how we currently manage this process: 1. Users click on an input field, the autocomplete popup is displayed, and Firefox searches for options so users can choose which value to autocomplete. 2. AutoCompleteChild searches for the value to autocomplete based on the type of the input field, along with the entire profile. For example, when we autocomplete a cc-number field, we also send cc-name, cc-exp, etc., to the child process. 3. AutoCompleteController autocompletes the focused input. 4. AutoCompleteController notifies the corresponding module, which then autofills the remaining fields. Currently, step 4 is triggered directly in the child process. This patch moves the logic of step 4 from the child process to the parent process. This change is a prerequisite for supporting autofill across frames and will also enable us not to send the entire profile in step 2. Differential Revision: https://phabricator.services.mozilla.com/D208752
99 lines
2.9 KiB
Text
99 lines
2.9 KiB
Text
/* 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/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
interface nsIAutoCompleteInput;
|
|
interface nsIFormFillCompleteObserver;
|
|
|
|
webidl Element;
|
|
|
|
[scriptable, uuid(bd3c2662-a988-41ab-8c94-c15ed0e6ac7d)]
|
|
interface nsIAutoCompletePopup : nsISupports
|
|
{
|
|
/*
|
|
* The input object that the popup is currently bound to
|
|
*/
|
|
readonly attribute nsIAutoCompleteInput input;
|
|
|
|
/*
|
|
* An alternative value to be used when text is entered, rather than the
|
|
* value of the selected item
|
|
*/
|
|
readonly attribute AString overrideValue;
|
|
|
|
/*
|
|
* The index of the result item that is currently selected
|
|
*/
|
|
attribute long selectedIndex;
|
|
|
|
/*
|
|
* Indicates if the popup is currently open
|
|
*/
|
|
readonly attribute boolean popupOpen;
|
|
|
|
/*
|
|
* Don't rollup the popup when the search string becomes "".
|
|
*/
|
|
boolean getNoRollupOnEmptySearch(in Element element);
|
|
|
|
/*
|
|
* Bind the popup to an input object and display it with the given coordinates
|
|
*
|
|
* @param input - The input object that the popup will be bound to
|
|
* @param element - The element that the popup will be aligned with
|
|
*/
|
|
void openAutocompletePopup(in nsIAutoCompleteInput input, in Element element);
|
|
|
|
/*
|
|
* Close the popup and detach from the bound input
|
|
*/
|
|
void closePopup();
|
|
|
|
/*
|
|
* Instruct the result view to repaint itself to reflect the most current
|
|
* underlying data
|
|
*
|
|
* @param reason - The reason the popup needs to be invalidated, one of the
|
|
* INVALIDATE_REASON consts.
|
|
*/
|
|
void invalidate(in unsigned short reason);
|
|
|
|
/*
|
|
* Possible values of invalidate()'s 'reason' argument.
|
|
*/
|
|
const unsigned short INVALIDATE_REASON_NEW_RESULT = 0;
|
|
const unsigned short INVALIDATE_REASON_DELETE = 1;
|
|
|
|
/*
|
|
* Change the selection relative to the current selection and make sure
|
|
* the newly selected row is visible
|
|
*
|
|
* @param reverse - Select a row above the current selection
|
|
* @param page - Select a row that is a full visible page from the current selection
|
|
* @return The currently selected result item index
|
|
*/
|
|
void selectBy(in boolean reverse, in boolean page);
|
|
|
|
/*
|
|
* Search for a given string and notify a listener (either synchronously
|
|
* or asynchronously) of the result
|
|
*
|
|
* @param searchString - The string to search for
|
|
* @param searchParam - An extra parameter
|
|
* @param previousResult - A previous result to use for faster searching
|
|
* @param listener - A listener to notify when the search is complete
|
|
*/
|
|
void startSearch(in AString searchString, in Element element, in nsIFormFillCompleteObserver listener);
|
|
|
|
/*
|
|
* Stop the search that is in progress
|
|
*/
|
|
void stopSearch();
|
|
|
|
/**
|
|
* Notify the autocomplete popup that an autocomplete entry is selected.
|
|
*/
|
|
void selectEntry();
|
|
};
|