OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ |
7 | 7 |
8 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
9 #include "components/autofill/core/browser/autofill_type.h" | 9 #include "components/autofill/core/browser/autofill_type.h" |
10 #include "components/autofill/core/browser/field_types.h" | 10 #include "components/autofill/core/browser/field_types.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // site-requested |field|. | 38 // site-requested |field|. |
39 bool ServerTypeMatchesField(DialogSection section, | 39 bool ServerTypeMatchesField(DialogSection section, |
40 ServerFieldType type, | 40 ServerFieldType type, |
41 const AutofillField& field); | 41 const AutofillField& field); |
42 | 42 |
43 // Returns true if the |type| belongs to the CREDIT_CARD field type group. | 43 // Returns true if the |type| belongs to the CREDIT_CARD field type group. |
44 bool IsCreditCardType(ServerFieldType type); | 44 bool IsCreditCardType(ServerFieldType type); |
45 | 45 |
46 // Constructs |inputs| from template data for a given |dialog_section|. | 46 // Constructs |inputs| from template data for a given |dialog_section|. |
47 // |country_country| specifies the country code that the inputs should be built | 47 // |country_country| specifies the country code that the inputs should be built |
48 // for. | 48 // for. Sets the |language_code| to be used for address formatting, if |
| 49 // internationalized address input is enabled. The |language_code| parameter can |
| 50 // be NULL. |
49 void BuildInputsForSection(DialogSection dialog_section, | 51 void BuildInputsForSection(DialogSection dialog_section, |
50 const std::string& country_code, | 52 const std::string& country_code, |
51 DetailInputs* inputs); | 53 DetailInputs* inputs, |
| 54 std::string* language_code); |
52 | 55 |
53 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding | 56 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding |
54 // to the |section|. | 57 // to the |section|. |
55 AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent( | 58 AutofillMetrics::DialogUiEvent DialogSectionToUiItemAddedEvent( |
56 DialogSection section); | 59 DialogSection section); |
57 | 60 |
58 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding | 61 // Returns the AutofillMetrics::DIALOG_UI_*_ITEM_ADDED metric corresponding |
59 // to the |section|. | 62 // to the |section|. |
60 AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent( | 63 AutofillMetrics::DialogUiEvent DialogSectionToUiSelectionChangedEvent( |
61 DialogSection section); | 64 DialogSection section); |
62 | 65 |
63 // Gets just the |type| attributes from each DetailInput. | 66 // Gets just the |type| attributes from each DetailInput. |
64 std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs); | 67 std::vector<ServerFieldType> TypesFromInputs(const DetailInputs& inputs); |
65 | 68 |
66 } // namespace common | 69 } // namespace common |
67 } // namespace autofill | 70 } // namespace autofill |
68 | 71 |
69 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ | 72 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_COMMON_H_ |
OLD | NEW |