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_PUBLIC_CPP_CREDENTIAL_MANAGER_STRUCT
_TRAITS_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_CPP_CREDENTIAL_MANAGER_STRUCT
_TRAITS_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_CPP_CREDENTIAL_MANAGER_STRUCT
_TRAITS_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_CPP_CREDENTIAL_MANAGER_STRUCT
_TRAITS_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "components/password_manager/content/public/interfaces/credential_manag
er.mojom.h" | 9 #include "components/password_manager/content/public/interfaces/credential_manag
er.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 StructTraits<password_manager::mojom::CredentialInfo, | 25 struct StructTraits<password_manager::mojom::CredentialInfoDataView, |
26 password_manager::CredentialInfo> { | 26 password_manager::CredentialInfo> { |
27 static password_manager::CredentialType type( | 27 static password_manager::CredentialType type( |
28 const password_manager::CredentialInfo& r) { | 28 const password_manager::CredentialInfo& r) { |
29 return r.type; | 29 return r.type; |
30 } | 30 } |
31 | 31 |
32 static const base::string16& id(const password_manager::CredentialInfo& r) { | 32 static const base::string16& id(const password_manager::CredentialInfo& r) { |
33 return r.id; | 33 return r.id; |
34 } | 34 } |
35 | 35 |
(...skipping 15 matching lines...) Expand all Loading... |
51 return r.federation; | 51 return r.federation; |
52 } | 52 } |
53 | 53 |
54 static bool Read(password_manager::mojom::CredentialInfoDataView data, | 54 static bool Read(password_manager::mojom::CredentialInfoDataView data, |
55 password_manager::CredentialInfo* out); | 55 password_manager::CredentialInfo* out); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace mojo | 58 } // namespace mojo |
59 | 59 |
60 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_CPP_CREDENTIAL_MANAGER_STR
UCT_TRAITS_H_ | 60 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_PUBLIC_CPP_CREDENTIAL_MANAGER_STR
UCT_TRAITS_H_ |
OLD | NEW |