Index: components/login/base_screen_handler_utils.cc |
diff --git a/components/login/base_screen_handler_utils.cc b/components/login/base_screen_handler_utils.cc |
index 6454cdf87b2a1d70dd8f899ff0c4ef31352852dd..fd977a33eaa943eb2b2170b280ae12f0579f9945 100644 |
--- a/components/login/base_screen_handler_utils.cc |
+++ b/components/login/base_screen_handler_utils.cc |
@@ -3,6 +3,8 @@ |
// found in the LICENSE file. |
#include "components/login/base_screen_handler_utils.h" |
+ |
+#include "components/signin/core/account_id/account_id.h" |
namespace login { |
@@ -56,6 +58,20 @@ |
return ParseStringList(value, out_value); |
} |
+bool ParseValue(const base::Value* value, AccountId* out_value) { |
+ std::string serialized; |
+ const bool has_string = value->GetAsString(&serialized); |
+ if (!has_string) |
+ return false; |
+ |
+ if (AccountId::Deserialize(serialized, out_value)) |
+ return true; |
+ |
+ LOG(ERROR) << "Failed to deserialize '" << serialized << "'"; |
+ *out_value = AccountId::FromUserEmail(serialized); |
+ return true; |
+} |
+ |
base::FundamentalValue MakeValue(bool v) { |
return base::FundamentalValue(v); |
} |
@@ -76,4 +92,11 @@ |
return base::StringValue(v); |
} |
+base::StringValue MakeValue(const AccountId& v) { |
+ return base::StringValue(v.Serialize()); |
+} |
+ |
+ParsedValueContainer<AccountId>::ParsedValueContainer() { |
+} |
+ |
} // namespace login |