OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ | 5 #ifndef COMPONENTS_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ |
6 #define COMPONENTS_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ | 6 #define COMPONENTS_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/signin/core/account_id/account_id.h" | 10 #include "components/signin/core/account_id/account_id.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Bail if there is no user email. | 93 // Bail if there is no user email. |
94 if (user_email.empty()) | 94 if (user_email.empty()) |
95 return false; | 95 return false; |
96 | 96 |
97 *out = AccountId::FromUserEmail(user_email); | 97 *out = AccountId::FromUserEmail(user_email); |
98 break; | 98 break; |
99 } | 99 } |
100 | 100 |
101 return out->is_valid(); | 101 return out->is_valid(); |
102 } | 102 } |
| 103 |
| 104 static bool IsNull(const AccountId& input) { return !input.is_valid(); } |
| 105 |
| 106 static void SetToNull(AccountId* output) { *output = EmptyAccountId(); } |
103 }; | 107 }; |
104 | 108 |
105 } // namespace mojo | 109 } // namespace mojo |
106 | 110 |
107 #endif // COMPONENTS_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ | 111 #endif // COMPONENTS_SIGNIN_PUBLIC_INTERFACES_ACCOUNT_ID_TRAITS_H_ |
OLD | NEW |