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 <cstddef> | 8 #include <cstddef> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 typename UnwrapConstRef<A3>::Type arg3; | 115 typename UnwrapConstRef<A3>::Type arg3; |
116 typename UnwrapConstRef<A4>::Type arg4; | 116 typename UnwrapConstRef<A4>::Type arg4; |
117 if (!GetArg(args, 0, &arg1) || !GetArg(args, 1, &arg2) || | 117 if (!GetArg(args, 0, &arg1) || !GetArg(args, 1, &arg2) || |
118 !GetArg(args, 2, &arg3) || !GetArg(args, 3, &arg4)) { | 118 !GetArg(args, 2, &arg3) || !GetArg(args, 3, &arg4)) { |
119 NOTREACHED(); | 119 NOTREACHED(); |
120 return; | 120 return; |
121 } | 121 } |
122 callback.Run(arg1, arg2, arg3, arg4); | 122 callback.Run(arg1, arg2, arg3, arg4); |
123 } | 123 } |
124 | 124 |
| 125 template <typename A1, typename A2, typename A3, typename A4, typename A5> |
| 126 void CallbackWrapper5(base::Callback<void(A1, A2, A3, A4, A5)> callback, |
| 127 const base::ListValue* args) { |
| 128 DCHECK(args); |
| 129 DCHECK_EQ(5u, args->GetSize()); |
| 130 typename UnwrapConstRef<A1>::Type arg1; |
| 131 typename UnwrapConstRef<A2>::Type arg2; |
| 132 typename UnwrapConstRef<A3>::Type arg3; |
| 133 typename UnwrapConstRef<A4>::Type arg4; |
| 134 typename UnwrapConstRef<A5>::Type arg5; |
| 135 if (!GetArg(args, 0, &arg1) || !GetArg(args, 1, &arg2) || |
| 136 !GetArg(args, 2, &arg3) || !GetArg(args, 3, &arg4) || |
| 137 !GetArg(args, 4, &arg5)) { |
| 138 NOTREACHED(); |
| 139 return; |
| 140 } |
| 141 callback.Run(arg1, arg2, arg3, arg4, arg5); |
| 142 } |
| 143 |
125 } // namespace login | 144 } // namespace login |
126 | 145 |
127 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ | 146 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ |
OLD | NEW |