Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/base_screen_handler.h |
| diff --git a/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h |
| index b1b6e8b449a6e60ef4a80f18b9cbb099977a626a..ce576470bec1fb936cfbb05b088b91fa810f2b80 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h |
| +++ b/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h |
| @@ -172,6 +172,22 @@ class BaseScreenHandler : public content::WebUIMessageHandler, |
| name, base::Bind(&::login::CallbackWrapper4<A1, A2, A3, A4>, callback)); |
| } |
| + template <typename T, |
| + typename A1, |
| + typename A2, |
| + typename A3, |
| + typename A4, |
| + typename A5> |
|
Mattias Nissler (ping if slow)
2015/03/25 08:28:18
I think this should be using variadic template arg
xiyuan
2015/03/25 19:26:19
Good point. However, it is not trivial to change (
|
| + void AddCallback( |
| + const std::string& name, |
| + void (T::*method)(A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)) { |
| + base::Callback<void(A1, A2, A3, A4, A5)> callback = |
| + base::Bind(method, base::Unretained(static_cast<T*>(this))); |
| + web_ui()->RegisterMessageCallback( |
| + name, |
| + base::Bind(&::login::CallbackWrapper5<A1, A2, A3, A4, A5>, callback)); |
| + } |
| + |
| template <typename Method> |
| void AddPrefixedCallback(const std::string& unprefixed_name, |
| const Method& method) { |