OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
| 10 #include "base/i18n/rtl.h" |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #include "components/autofill/content/common/autofill_types.mojom.h" | 12 #include "components/autofill/content/common/autofill_types.mojom.h" |
12 #include "components/autofill/core/common/form_data.h" | 13 #include "components/autofill/core/common/form_data.h" |
13 #include "components/autofill/core/common/form_data_predictions.h" | 14 #include "components/autofill/core/common/form_data_predictions.h" |
14 #include "components/autofill/core/common/form_field_data.h" | 15 #include "components/autofill/core/common/form_field_data.h" |
15 #include "components/autofill/core/common/form_field_data_predictions.h" | 16 #include "components/autofill/core/common/form_field_data_predictions.h" |
16 #include "components/autofill/core/common/password_form.h" | 17 #include "components/autofill/core/common/password_form.h" |
17 #include "components/autofill/core/common/password_form_field_prediction_map.h" | 18 #include "components/autofill/core/common/password_form_field_prediction_map.h" |
18 #include "components/autofill/core/common/password_form_fill_data.h" | 19 #include "components/autofill/core/common/password_form_fill_data.h" |
19 #include "components/autofill/core/common/password_form_generation_data.h" | 20 #include "components/autofill/core/common/password_form_generation_data.h" |
(...skipping 13 matching lines...) Expand all Loading... |
33 template <> | 34 template <> |
34 struct EnumTraits<autofill::mojom::RoleAttribute, | 35 struct EnumTraits<autofill::mojom::RoleAttribute, |
35 autofill::FormFieldData::RoleAttribute> { | 36 autofill::FormFieldData::RoleAttribute> { |
36 static autofill::mojom::RoleAttribute ToMojom( | 37 static autofill::mojom::RoleAttribute ToMojom( |
37 autofill::FormFieldData::RoleAttribute input); | 38 autofill::FormFieldData::RoleAttribute input); |
38 static bool FromMojom(autofill::mojom::RoleAttribute input, | 39 static bool FromMojom(autofill::mojom::RoleAttribute input, |
39 autofill::FormFieldData::RoleAttribute* output); | 40 autofill::FormFieldData::RoleAttribute* output); |
40 }; | 41 }; |
41 | 42 |
42 template <> | 43 template <> |
43 struct EnumTraits<autofill::mojom::TextDirection, base::i18n::TextDirection> { | |
44 static autofill::mojom::TextDirection ToMojom( | |
45 base::i18n::TextDirection input); | |
46 static bool FromMojom(autofill::mojom::TextDirection input, | |
47 base::i18n::TextDirection* output); | |
48 }; | |
49 | |
50 template <> | |
51 struct EnumTraits<autofill::mojom::GenerationUploadStatus, | 44 struct EnumTraits<autofill::mojom::GenerationUploadStatus, |
52 autofill::PasswordForm::GenerationUploadStatus> { | 45 autofill::PasswordForm::GenerationUploadStatus> { |
53 static autofill::mojom::GenerationUploadStatus ToMojom( | 46 static autofill::mojom::GenerationUploadStatus ToMojom( |
54 autofill::PasswordForm::GenerationUploadStatus input); | 47 autofill::PasswordForm::GenerationUploadStatus input); |
55 static bool FromMojom(autofill::mojom::GenerationUploadStatus input, | 48 static bool FromMojom(autofill::mojom::GenerationUploadStatus input, |
56 autofill::PasswordForm::GenerationUploadStatus* output); | 49 autofill::PasswordForm::GenerationUploadStatus* output); |
57 }; | 50 }; |
58 | 51 |
59 template <> | 52 template <> |
60 struct EnumTraits<autofill::mojom::PasswordFormLayout, | 53 struct EnumTraits<autofill::mojom::PasswordFormLayout, |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 return static_cast<KeysValuesPair*>(context)->second; | 580 return static_cast<KeysValuesPair*>(context)->second; |
588 } | 581 } |
589 | 582 |
590 static bool Read(autofill::mojom::FormsPredictionsMapDataView data, | 583 static bool Read(autofill::mojom::FormsPredictionsMapDataView data, |
591 autofill::FormsPredictionsMap* out); | 584 autofill::FormsPredictionsMap* out); |
592 }; | 585 }; |
593 | 586 |
594 } // namespace mojo | 587 } // namespace mojo |
595 | 588 |
596 #endif // COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ | 589 #endif // COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_TYPES_STRUCT_TRAITS_H_ |
OLD | NEW |