Allow the C++ JS binding function to accept arbitrary long arguments
This commit is contained in:
parent
da724d65d7
commit
1578d2fda9
3 changed files with 7 additions and 10 deletions
|
@ -43,17 +43,12 @@ void ShowMessageBox(int type,
|
||||||
const std::vector<std::string>& buttons,
|
const std::vector<std::string>& buttons,
|
||||||
int cancel_id,
|
int cancel_id,
|
||||||
int options,
|
int options,
|
||||||
const std::vector<std::string>& texts,
|
const std::string& title,
|
||||||
|
const std::string& message,
|
||||||
|
const std::string& detail,
|
||||||
const gfx::ImageSkia& icon,
|
const gfx::ImageSkia& icon,
|
||||||
atom::NativeWindow* window,
|
atom::NativeWindow* window,
|
||||||
mate::Arguments* args) {
|
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();
|
v8::Local<v8::Value> peek = args->PeekNext();
|
||||||
atom::MessageBoxCallback callback;
|
atom::MessageBoxCallback callback;
|
||||||
if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
|
if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
|
||||||
|
|
|
@ -105,7 +105,9 @@ module.exports =
|
||||||
options.buttons,
|
options.buttons,
|
||||||
options.cancelId,
|
options.cancelId,
|
||||||
0,
|
0,
|
||||||
[options.title, options.message, options.detail],
|
options.title,
|
||||||
|
options.message,
|
||||||
|
options.detail,
|
||||||
options.icon,
|
options.icon,
|
||||||
window,
|
window,
|
||||||
callback
|
callback
|
||||||
|
|
2
vendor/native_mate
vendored
2
vendor/native_mate
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 41cd6d13c9c9be164f427864277f3cc36b69eb39
|
Subproject commit 656e403f0102c59428261c1eaad22912d2bbd3c5
|
Loading…
Add table
Add a link
Reference in a new issue