Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: components/password_manager/content/public/cpp/credential_manager_struct_traits.h

Issue 2253293002: Mojo C++ bindings: change the first template parameter of StructTraits and UnionTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@91_extra
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698