File: form_suggestion_provider_query.h

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (72 lines) | stat: -rw-r--r-- 2,852 bytes parent folder | download | duplicates (4)
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
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_AUTOFILL_IOS_BROWSER_FORM_SUGGESTION_PROVIDER_QUERY_H_
#define COMPONENTS_AUTOFILL_IOS_BROWSER_FORM_SUGGESTION_PROVIDER_QUERY_H_

#import <Foundation/Foundation.h>

#import "components/autofill/core/common/unique_ids.h"

namespace {
// The "password" field type does not explicitly mean that the field contains a
// password, it means that the field obfuscates its information instead of
// showing it plainly.
NSString* const kObfuscatedFieldType = @"password";
}  // namespace

// A class containing the data necessary for FormSuggestionProvider to
// find and retrieve user-selectable suggestions for an input field of
// a web form.
@interface FormSuggestionProviderQuery : NSObject

// Form HTML 'name' attribute. If missing, its 'id' attribute. If also
// missing, a name assigned by Chrome in __gCrWeb.form.getFormIdentifier.
@property(readonly, nonatomic, copy) NSString* formName;

// Number ID, unique for a frame.
@property(readonly, nonatomic) autofill::FormRendererId formRendererID;

// Field HTML 'id' attribute. If missing, its 'name' attribute. If also
// missing, a unique string path assigned in __gCrWeb.form.getFieldIdentifier.
@property(readonly, nonatomic, copy) NSString* fieldIdentifier;

// Number ID, unique for a frame.
@property(readonly, nonatomic) autofill::FieldRendererId fieldRendererID;

// HTML input field type (i.e. 'text', 'password').
@property(readonly, nonatomic, copy) NSString* fieldType;

// Type of form activity that initiates the query (i.e. 'focus', 'blur',
// 'form_changed').
@property(readonly, nonatomic, copy) NSString* type;

// The value contained in a field.
@property(readonly, nonatomic, copy) NSString* typedValue;

// ID of a frame containing the form.
@property(readonly, nonatomic, copy) NSString* frameID;

// YES if only passwords should be returned as suggestions (e.g. no password
// generation suggestion).
@property(readonly, nonatomic, assign) BOOL onlyPassword;

- (instancetype)initWithFormName:(NSString*)formName
                  formRendererID:(autofill::FormRendererId)formRendererID
                 fieldIdentifier:(NSString*)fieldIdentifier
                 fieldRendererID:(autofill::FieldRendererId)fieldRendererID
                       fieldType:(NSString*)fieldType
                            type:(NSString*)type
                      typedValue:(NSString*)typedValue
                         frameID:(NSString*)frameID
                    onlyPassword:(BOOL)onlyPassword NS_DESIGNATED_INITIALIZER;

- (instancetype)init NS_UNAVAILABLE;

// Returns true if a query comes from a focus on a field.
- (BOOL)hasFocusType;

@end

#endif  // COMPONENTS_AUTOFILL_IOS_BROWSER_FORM_SUGGESTION_PROVIDER_QUERY_H_