| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ | 5 #ifndef COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ |
| 6 #define COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ | 6 #define COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <cstddef> | 10 #include <cstddef> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 bool LOGIN_EXPORT ParseValue(const base::Value* value, AccountId* out_value); | 46 bool LOGIN_EXPORT ParseValue(const base::Value* value, AccountId* out_value); |
| 47 | 47 |
| 48 template <typename T> | 48 template <typename T> |
| 49 inline bool GetArg(const base::ListValue* args, size_t index, T* out_value) { | 49 inline bool GetArg(const base::ListValue* args, size_t index, T* out_value) { |
| 50 const base::Value* value; | 50 const base::Value* value; |
| 51 if (!args->Get(index, &value)) | 51 if (!args->Get(index, &value)) |
| 52 return false; | 52 return false; |
| 53 return ParseValue(value, out_value); | 53 return ParseValue(value, out_value); |
| 54 } | 54 } |
| 55 | 55 |
| 56 base::FundamentalValue LOGIN_EXPORT MakeValue(bool v); | 56 base::Value LOGIN_EXPORT MakeValue(bool v); |
| 57 base::FundamentalValue LOGIN_EXPORT MakeValue(int v); | 57 base::Value LOGIN_EXPORT MakeValue(int v); |
| 58 base::FundamentalValue LOGIN_EXPORT MakeValue(double v); | 58 base::Value LOGIN_EXPORT MakeValue(double v); |
| 59 base::StringValue LOGIN_EXPORT MakeValue(const std::string& v); | 59 base::StringValue LOGIN_EXPORT MakeValue(const std::string& v); |
| 60 base::StringValue LOGIN_EXPORT MakeValue(const base::string16& v); | 60 base::StringValue LOGIN_EXPORT MakeValue(const base::string16& v); |
| 61 base::StringValue LOGIN_EXPORT MakeValue(const AccountId& v); | 61 base::StringValue LOGIN_EXPORT MakeValue(const AccountId& v); |
| 62 | 62 |
| 63 template <typename T> | 63 template <typename T> |
| 64 inline const T& MakeValue(const T& v) { | 64 inline const T& MakeValue(const T& v) { |
| 65 return v; | 65 return v; |
| 66 } | 66 } |
| 67 | 67 |
| 68 template <typename T> | 68 template <typename T> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 97 void CallbackWrapper(const base::Callback<void(Args...)>& callback, | 97 void CallbackWrapper(const base::Callback<void(Args...)>& callback, |
| 98 const base::ListValue* args) { | 98 const base::ListValue* args) { |
| 99 DispatchToCallback(callback, args, | 99 DispatchToCallback(callback, args, |
| 100 base::MakeIndexSequence<sizeof...(Args)>()); | 100 base::MakeIndexSequence<sizeof...(Args)>()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 } // namespace login | 104 } // namespace login |
| 105 | 105 |
| 106 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ | 106 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ |
| OLD | NEW |