| Index: components/login/base_screen_handler_utils.h
|
| diff --git a/components/login/base_screen_handler_utils.h b/components/login/base_screen_handler_utils.h
|
| index 71d2e7f1687ff6417d0dd839878532f017694c7a..7d884d2d42996a5072d974b6f7b37df173c4c0cd 100644
|
| --- a/components/login/base_screen_handler_utils.h
|
| +++ b/components/login/base_screen_handler_utils.h
|
| @@ -14,6 +14,7 @@
|
| #include "base/tuple.h"
|
| #include "base/values.h"
|
| #include "components/login/login_export.h"
|
| +#include "components/signin/core/account_id/account_id.h"
|
|
|
| namespace login {
|
|
|
| @@ -40,6 +41,7 @@
|
| const base::DictionaryValue** out_value);
|
| bool LOGIN_EXPORT ParseValue(const base::Value* value, StringList* out_value);
|
| bool LOGIN_EXPORT ParseValue(const base::Value* value, String16List* out_value);
|
| +bool LOGIN_EXPORT ParseValue(const base::Value* value, AccountId* out_value);
|
|
|
| template <typename T>
|
| inline bool GetArg(const base::ListValue* args, size_t index, T* out_value) {
|
| @@ -54,17 +56,29 @@
|
| base::FundamentalValue LOGIN_EXPORT MakeValue(double v);
|
| base::StringValue LOGIN_EXPORT MakeValue(const std::string& v);
|
| base::StringValue LOGIN_EXPORT MakeValue(const base::string16& v);
|
| +base::StringValue LOGIN_EXPORT MakeValue(const AccountId& v);
|
|
|
| template <typename T>
|
| inline const T& MakeValue(const T& v) {
|
| return v;
|
| }
|
|
|
| +template <typename T>
|
| +struct ParsedValueContainer {
|
| + T value;
|
| +};
|
| +
|
| +template <>
|
| +struct LOGIN_EXPORT ParsedValueContainer<AccountId> {
|
| + ParsedValueContainer();
|
| + AccountId value = EmptyAccountId();
|
| +};
|
| +
|
| template <typename Arg, size_t index>
|
| typename UnwrapConstRef<Arg>::Type ParseArg(const base::ListValue* args) {
|
| - typename UnwrapConstRef<Arg>::Type parsed;
|
| - CHECK(GetArg(args, index, &parsed));
|
| - return parsed;
|
| + ParsedValueContainer<typename UnwrapConstRef<Arg>::Type> parsed;
|
| + CHECK(GetArg(args, index, &parsed.value));
|
| + return parsed.value;
|
| }
|
|
|
| template <typename... Args, size_t... Ns>
|
|
|