]> khamidou — GitHub mirrors - electron.git/commitdiff
Allow the C++ JS binding function to accept arbitrary long arguments
authorCheng Zhao <zcbenz@gmail.com>
Thu, 23 Jul 2015 07:00:42 +0000 (15:00 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 23 Jul 2015 07:00:42 +0000 (15:00 +0800)
atom/browser/api/atom_api_dialog.cc
atom/browser/api/lib/dialog.coffee
vendor/native_mate

index 695c11e336eef1e6957f6935861c9d915233153a..47021407e1ea621a23d27b18d624c069e4a16ba5 100644 (file)
@@ -43,17 +43,12 @@ void ShowMessageBox(int type,
                     const std::vector<std::string>& buttons,
                     int cancel_id,
                     int options,
-                    const std::vector<std::string>& texts,
+                    const std::string& title,
+                    const std::string& message,
+                    const std::string& detail,
                     const gfx::ImageSkia& icon,
                     atom::NativeWindow* window,
                     mate::Arguments* args) {
-  // FIXME We are exceeding the parameters limit of base::Bind here, so we have
-  // to pass some parameters in an array. We should remove this once we have
-  // variadic template support in base::Bind.
-  const std::string& title = texts[0];
-  const std::string& message = texts[1];
-  const std::string& detail = texts[2];
-
   v8::Local<v8::Value> peek = args->PeekNext();
   atom::MessageBoxCallback callback;
   if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
index 35ef6240918c30e0156ec24a08bcbd3853dc8088..a1dcaafe78fefd0caf4aa89f578d7ad12d9b07a5 100644 (file)
@@ -105,7 +105,9 @@ module.exports =
                            options.buttons,
                            options.cancelId,
                            0,
-                           [options.title, options.message, options.detail],
+                           options.title,
+                           options.message,
+                           options.detail,
                            options.icon,
                            window,
                            callback
index 41cd6d13c9c9be164f427864277f3cc36b69eb39..656e403f0102c59428261c1eaad22912d2bbd3c5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 41cd6d13c9c9be164f427864277f3cc36b69eb39
+Subproject commit 656e403f0102c59428261c1eaad22912d2bbd3c5