File: api_v1.proto

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (144 lines) | stat: -rw-r--r-- 5,982 bytes parent folder | download | duplicates (5)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Data models to interface with Autofill API v1.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package autofill;

import "password_requirements.proto";
import "server.proto";

// Request to retrieve field suggestions from Autofill API for forms in a page
// that can be used as a resource ID in a RESTful interface.
message AutofillPageResourceQueryRequest {
  // Serialized AutofillPageQueryRequest encoded in base64. We cannot use
  // "bytes" because this is not supported by the API. The serialized_request is
  // also a distinct signature that can be used for caching.
  optional string serialized_request = 1;
};

// Request to retrieve field suggestions for multiple forms in a page. You can
// see this as batched form requests.
// Next ID: 4
message AutofillPageQueryRequest {
  // Next ID: 5
  message Form {
    // Next ID: 5
    message Field {
      // Signature made of the field |name| and |control_type|.
      optional fixed32 signature = 1;
      reserved 2, 3, 4;
    };
    // Signature of the form that is made of:
    //  - URL scheme (e.g., "http")
    //  - URL domain page (e.g., "google.com")
    //  - Form name (e.g., "Sign In")
    //  - Concatenated field names (e.g., "First Name", "Last Name")
    optional fixed64 signature = 1;
    // Fields of the form for which we want suggestions.
    repeated Field fields = 2;
    reserved 3;
    // Alternative signature of the form that is made of:
    //  - URL scheme (e.g., "http")
    //  - URL domain page (e.g., "google.com")
    //  - Concatenated fields' form control types (e.g., "text", "password")
    //  - For forms with 1-2 fields, one of the following non-empty elements
    //  ordered by preference: path, reference, or query.
    optional fixed64 alternative_signature = 4;
  };
  // Version of the client. Do not use, deprecated.
  optional string client_version = 1 [deprecated = true];
  // Forms in the same page for which we want fields suggestions.
  repeated Form forms = 2;
  // The collection of server-side experiments to use.
  repeated int64 experiments = 3;
};

// Response containing field suggestions from Autofill API for
// AutofillPageQueryRequest request. Form and fields are in the exact same order
// as in the request that gave the response.
// Next ID: 2
message AutofillQueryResponse {
  // Next ID: 3
  message FormSuggestion {
    // Next ID: 9
    message FieldSuggestion {
      // Prediction made on a field.
      // Next ID: 5
      message FieldPrediction {
        // This lists all the different ways predictions can be provided,
        // including some experiments.
        enum Source {
          // No source for this prediction. This is only valid for
          // NO_SERVER_DATA predictions.
          SOURCE_UNSPECIFIED = 0;
          // The autofill prediction, with no experiments enabled.
          SOURCE_AUTOFILL_DEFAULT = 1;
          // The password manager prediction, with no experiments enabled.
          SOURCE_PASSWORDS_DEFAULT = 2;
          // The prediction came from an override list.
          SOURCE_OVERRIDE = 3;
          // The autofill prediction came from the experiment which combines all
          // approved experiments.
          SOURCE_ALL_APPROVED_EXPERIMENTS = 4;
          // The autofill prediction came from the experiment which considers
          // fields ranks.
          SOURCE_FIELD_RANKS = 5;
          // The prediction was specified as a command line override (used for
          // testing purposes only).
          SOURCE_MANUAL_OVERRIDE = 6;
          // The autofill prediction came from the experiment which considers
          // combined types of addresses.
          SOURCE_AUTOFILL_COMBINED_TYPES = 7 [deprecated = true];
          // The prediction is a (cached) Autofill AI model prediction.
          SOURCE_AUTOFILL_AI = 8;
          // The prediction is a crowdsourced Autofill AI prediction based on
          // client type votes.
          SOURCE_AUTOFILL_AI_CROWDSOURCING = 9;
        }

        // The predicted field type.
        // See components/autofill/core/browser/field_types.h for defined types.
        // It is not guaranteed that the value of |type| is known to the enum.
        optional int32 type = 1;
        // Indicates if the prediction is an override.
        optional bool override = 2 [default = false];
        // The source of the prediction. E.g. which pipeline, which experiment,
        // etc.
        optional Source source = 3;
        reserved 4;  // repeated .autofill.AlternativeType alternative_types
      }
      // Signature identifying the field that is the same as in the request.
      optional fixed32 field_signature = 1;
      reserved 2;  // optional int32 primary_type_prediction
      // Detailed list of all possible predictions. Contains an autofill and/or
      // a password manager prediction.
      repeated FieldPrediction predictions = 3;
      reserved 4;  // optional bool may_use_prefilled_placeholder
      // For fields of type NEW_PASSWORD and ACCOUNT_CREATION_PASSWORD, this may
      // specify requirements for the generation of passwords.
      optional .autofill.PasswordRequirementsSpec password_requirements = 5;
      reserved 6;  // optional bool primary_type_prediction_is_override
      reserved 7;  // optional string format_string = 7;
      optional FormatString format_string = 8;
    };
    // Suggestions on the fields in the same form.
    repeated FieldSuggestion field_suggestions = 1;

    // Indicates whether the client may run the AutofillAI model on this form.
    optional bool run_autofill_ai_model = 2;
  };
  // Suggestions for forms in the same page.
  repeated FormSuggestion form_suggestions = 1;
};

// Next ID: 2
message AutofillUploadRequest {
  // Content of the upload for voting.
  optional AutofillUploadContents upload = 1;
}