blob: 0c6bd09e1baf2a35c1dfa09c0bf9fe990ac04646 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_
#define CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_
#pragma once
#include <vector>
#include "chrome/browser/autofill/autofill_field.h"
#include "chrome/browser/autofill/form_field.h"
// A form field that can parse either a FullNameField or a FirstLastNameField.
class NameField : public FormField {
public:
static NameField* Parse(std::vector<AutoFillField*>::const_iterator* iter,
bool is_ecml);
protected:
NameField() {}
private:
DISALLOW_COPY_AND_ASSIGN(NameField);
};
// A form field that can parse a full name field.
class FullNameField : public NameField {
public:
virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const;
static FullNameField* Parse(
std::vector<AutoFillField*>::const_iterator* iter);
private:
explicit FullNameField(AutoFillField* field);
AutoFillField* field_;
DISALLOW_COPY_AND_ASSIGN(FullNameField);
};
// A form field that can parse a first and last name field.
class FirstLastNameField : public NameField {
public:
static FirstLastNameField* Parse1(
std::vector<AutoFillField*>::const_iterator* iter);
static FirstLastNameField* Parse2(
std::vector<AutoFillField*>::const_iterator* iter);
static FirstLastNameField* ParseEcmlName(
std::vector<AutoFillField*>::const_iterator* iter);
static FirstLastNameField* Parse(
std::vector<AutoFillField*>::const_iterator* iter, bool is_ecml);
virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const;
private:
FirstLastNameField();
AutoFillField* first_name_;
AutoFillField* middle_name_; // Optional.
AutoFillField* last_name_;
bool middle_initial_; // True if middle_name_ is a middle initial.
DISALLOW_COPY_AND_ASSIGN(FirstLastNameField);
};
#endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_
|