- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / autofill / autofill_dialog_common.h
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_
7
8 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
9 #include "components/autofill/core/browser/autofill_type.h"
10 #include "components/autofill/core/browser/field_types.h"
11
12 namespace autofill {
13 class AutofillProfile;
14 }
15
16 namespace wallet {
17 class Address;
18 }
19
20 namespace autofill {
21 namespace common {
22
23 // Returns true if |input| should be shown when |field_type| has been requested.
24 bool InputTypeMatchesFieldType(const DetailInput& input,
25                                const AutofillType& field_type);
26
27 // Returns true if |input| in the given |section| should be used for a
28 // site-requested |field|.
29 bool DetailInputMatchesField(DialogSection section,
30                              const DetailInput& input,
31                              const AutofillField& field);
32
33 // Returns true if the |type| belongs to the CREDIT_CARD field type group.
34 bool IsCreditCardType(ServerFieldType type);
35
36 // Constructs |inputs| from template data for a given |dialog_section|.
37 void BuildInputsForSection(DialogSection dialog_section, DetailInputs* inputs);
38
39 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding
40 // to the |section|.
41 AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent(
42     DialogSection section);
43
44 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding
45 // to the |section|.
46 AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent(
47     DialogSection section);
48
49 // We hardcode some values. In particular, we don't yet allow the user to change
50 // the country: http://crbug.com/247518
51 string16 GetHardcodedValueForType(ServerFieldType type);
52
53 }  // namespace common
54 }  // namespace autofill
55
56 #endif  // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_