Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6028)

Unified Diff: chrome/browser/ui/webui/chromeos/login/base_screen_handler.h

Issue 14063018: Implemented argument wrapping for CallJS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/base_screen_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2d86325832a3a41f65b5914797053333ccb0ab25..8a718a4075d56abb1e92fa5267d9604f2c2dc8a6 100644
--- a/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h
@@ -92,20 +92,40 @@ class BaseScreenHandler : public content::WebUIMessageHandler {
// Shortcut for calling JS methods on WebUI side.
void CallJS(const std::string& method);
+
+ template<typename A1>
+ void CallJS(const std::string& method, const A1& arg1) {
+ web_ui()->CallJavascriptFunction(method, MakeValue(arg1));
+ }
+
+ template<typename A1, typename A2>
+ void CallJS(const std::string& method, const A1& arg1, const A2& arg2) {
+ web_ui()->CallJavascriptFunction(method, MakeValue(arg1), MakeValue(arg2));
+ }
+
+ template<typename A1, typename A2, typename A3>
void CallJS(const std::string& method,
- const base::Value& arg1);
- void CallJS(const std::string& method,
- const base::Value& arg1,
- const base::Value& arg2);
- void CallJS(const std::string& method,
- const base::Value& arg1,
- const base::Value& arg2,
- const base::Value& arg3);
+ const A1& arg1,
+ const A2& arg2,
+ const A3& arg3) {
+ web_ui()->CallJavascriptFunction(method,
+ MakeValue(arg1),
+ MakeValue(arg2),
+ MakeValue(arg3));
+ }
+
+ template<typename A1, typename A2, typename A3, typename A4>
void CallJS(const std::string& method,
- const base::Value& arg1,
- const base::Value& arg2,
- const base::Value& arg3,
- const base::Value& arg4);
+ const A1& arg1,
+ const A2& arg2,
+ const A3& arg3,
+ const A4& arg4) {
+ web_ui()->CallJavascriptFunction(method,
+ MakeValue(arg1),
+ MakeValue(arg2),
+ MakeValue(arg3),
+ MakeValue(arg4));
+ }
// Shortcut methods for adding WebUI callbacks.
template<typename T>
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/base_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698