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 SERVICES_SHELL_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ |
6 #define SERVICES_SHELL_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "services/shell/public/cpp/identity.h" | 8 #include "services/service_manager/public/cpp/identity.h" |
9 #include "services/shell/public/interfaces/connector.mojom.h" | 9 #include "services/service_manager/public/interfaces/connector.mojom.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 template <> | 13 template <> |
14 struct StructTraits<shell::mojom::IdentityDataView, shell::Identity> { | 14 struct StructTraits<shell::mojom::IdentityDataView, shell::Identity> { |
15 static const std::string& name(const shell::Identity& identity) { | 15 static const std::string& name(const shell::Identity& identity) { |
16 return identity.name(); | 16 return identity.name(); |
17 } | 17 } |
18 static const std::string& user_id(const shell::Identity& identity) { | 18 static const std::string& user_id(const shell::Identity& identity) { |
19 return identity.user_id(); | 19 return identity.user_id(); |
(...skipping 12 matching lines...) Expand all Loading... |
32 if (!data.ReadInstance(&instance)) | 32 if (!data.ReadInstance(&instance)) |
33 return false; | 33 return false; |
34 | 34 |
35 *out = shell::Identity(name, user_id, instance); | 35 *out = shell::Identity(name, user_id, instance); |
36 return true; | 36 return true; |
37 } | 37 } |
38 }; | 38 }; |
39 | 39 |
40 } // namespace mojo | 40 } // namespace mojo |
41 | 41 |
42 #endif // SERVICES_SHELL_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ | 42 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_IDENTITY_STRUCT_TRAITS_H_ |
OLD | NEW |