summaryrefslogtreecommitdiffstats
path: root/toolkit/components/formautofill/nsIFormAutofillContentService.idl
blob: 300645e7419ca511507c8d6fc11f4ea40e4c5503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* 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 nsIDOMHTMLFormElement;
interface nsIDOMWindow;

/**
 * Defines a service used by DOM content to request Form Autofill, in particular
 * when the requestAutocomplete method of Form objects is invoked.
 *
 * This service lives in the process that hosts the requesting DOM content.
 * This means that, in a multi-process (e10s) environment, there can be an
 * instance of the service for each content process, in addition to an instance
 * for the chrome process.
 *
 * @remarks The service implementation uses a child-side message manager to
 *          communicate with a parent-side message manager living in the chrome
 *          process, where most of the processing is located.
 */
[scriptable, uuid(1db29340-99df-4845-9102-0c5d281b2fe8)]
interface nsIFormAutofillContentService : nsISupports
{
  /**
   * Invoked by the requestAutocomplete method of the DOM Form object.
   *
   * The application is expected to display a user interface asking for the
   * details that are relevant to the form being filled in.  The application
   * should use the "autocomplete" attributes on the input elements as hints
   * about which type of information is being requested.
   *
   * The processing will result in either an "autocomplete" simple DOM Event or
   * an AutocompleteErrorEvent being fired on the form.
   *
   * @param aForm
   *        The form on which the requestAutocomplete method was invoked.
   * @param aWindow
   *        The window where the form is located.  This must be specified even
   *        for elements that are not in a document, and is used to generate the
   *        DOM events resulting from the operation.
   */
  void requestAutocomplete(in nsIDOMHTMLFormElement aForm,
                           in nsIDOMWindow aWindow);
};