| 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_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_TRA
ITS_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_TRA
ITS_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_TRA
ITS_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_TRA
ITS_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "components/password_manager/content/common/credential_manager.mojom.h" | 9 #include "components/password_manager/content/common/credential_manager.mojom.h" |
| 10 #include "components/password_manager/core/common/credential_manager_types.h" | 10 #include "components/password_manager/core/common/credential_manager_types.h" |
| 11 #include "mojo/public/cpp/bindings/struct_traits.h" | 11 #include "mojo/public/cpp/bindings/struct_traits.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 | 14 |
| 15 template <> | 15 template <> |
| 16 struct EnumTraits<password_manager::mojom::CredentialType, | 16 struct EnumTraits<password_manager::mojom::CredentialType, |
| 17 password_manager::CredentialType> { | 17 password_manager::CredentialType> { |
| 18 static password_manager::mojom::CredentialType ToMojom( | 18 static password_manager::mojom::CredentialType ToMojom( |
| 19 password_manager::CredentialType input); | 19 password_manager::CredentialType input); |
| 20 static bool FromMojom(password_manager::mojom::CredentialType input, | 20 static bool FromMojom(password_manager::mojom::CredentialType input, |
| 21 password_manager::CredentialType* output); | 21 password_manager::CredentialType* output); |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 template <> | 24 template <> |
| 25 struct EnumTraits<password_manager::mojom::CredentialMediationRequirement, |
| 26 password_manager::CredentialMediationRequirement> { |
| 27 static password_manager::mojom::CredentialMediationRequirement ToMojom( |
| 28 password_manager::CredentialMediationRequirement input); |
| 29 static bool FromMojom( |
| 30 password_manager::mojom::CredentialMediationRequirement input, |
| 31 password_manager::CredentialMediationRequirement* output); |
| 32 }; |
| 33 |
| 34 template <> |
| 25 struct StructTraits<password_manager::mojom::CredentialInfoDataView, | 35 struct StructTraits<password_manager::mojom::CredentialInfoDataView, |
| 26 password_manager::CredentialInfo> { | 36 password_manager::CredentialInfo> { |
| 27 static password_manager::CredentialType type( | 37 static password_manager::CredentialType type( |
| 28 const password_manager::CredentialInfo& r) { | 38 const password_manager::CredentialInfo& r) { |
| 29 return r.type; | 39 return r.type; |
| 30 } | 40 } |
| 31 | 41 |
| 32 static const base::string16& id(const password_manager::CredentialInfo& r) { | 42 static const base::string16& id(const password_manager::CredentialInfo& r) { |
| 33 return r.id; | 43 return r.id; |
| 34 } | 44 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 51 return r.federation; | 61 return r.federation; |
| 52 } | 62 } |
| 53 | 63 |
| 54 static bool Read(password_manager::mojom::CredentialInfoDataView data, | 64 static bool Read(password_manager::mojom::CredentialInfoDataView data, |
| 55 password_manager::CredentialInfo* out); | 65 password_manager::CredentialInfo* out); |
| 56 }; | 66 }; |
| 57 | 67 |
| 58 } // namespace mojo | 68 } // namespace mojo |
| 59 | 69 |
| 60 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_
TRAITS_H_ | 70 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_COMMON_CREDENTIAL_MANAGER_STRUCT_
TRAITS_H_ |
| OLD | NEW |