Make Menu API accept TopLevelWindow
This commit is contained in:
parent
1340b17424
commit
7473b612c5
10 changed files with 41 additions and 40 deletions
|
@ -118,27 +118,4 @@ class BrowserWindow : public TopLevelWindow,
|
|||
|
||||
} // namespace atom
|
||||
|
||||
namespace mate {
|
||||
|
||||
template <>
|
||||
struct Converter<atom::NativeWindow*> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
atom::NativeWindow** out) {
|
||||
// null would be tranfered to NULL.
|
||||
if (val->IsNull()) {
|
||||
*out = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
atom::api::BrowserWindow* window;
|
||||
if (!Converter<atom::api::BrowserWindow*>::FromV8(isolate, val, &window))
|
||||
return false;
|
||||
*out = window->window();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mate
|
||||
|
||||
#endif // ATOM_BROWSER_API_ATOM_API_BROWSER_WINDOW_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue