Added getNativeWindowHandle
This commit is contained in:
parent
9e254821bb
commit
3f0c007578
6 changed files with 14 additions and 1 deletions
|
@ -594,6 +594,11 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
|
||||||
window_->SetAspectRatio(aspect_ratio, extra_size);
|
window_->SetAspectRatio(aspect_ratio, extra_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v8::Local<v8::Value> Window::GetNativeWindowHandle() {
|
||||||
|
gfx::AcceleratedWidget handle = window_->GetAcceleratedWidget();
|
||||||
|
return ToBuffer(isolate(), static_cast<void*>(&handle), sizeof(gfx::AcceleratedWidget));
|
||||||
|
}
|
||||||
|
|
||||||
void Window::SetVisibleOnAllWorkspaces(bool visible) {
|
void Window::SetVisibleOnAllWorkspaces(bool visible) {
|
||||||
return window_->SetVisibleOnAllWorkspaces(visible);
|
return window_->SetVisibleOnAllWorkspaces(visible);
|
||||||
}
|
}
|
||||||
|
@ -634,6 +639,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
|
||||||
.SetMethod("setFullScreen", &Window::SetFullScreen)
|
.SetMethod("setFullScreen", &Window::SetFullScreen)
|
||||||
.SetMethod("isFullScreen", &Window::IsFullscreen)
|
.SetMethod("isFullScreen", &Window::IsFullscreen)
|
||||||
.SetMethod("setAspectRatio", &Window::SetAspectRatio)
|
.SetMethod("setAspectRatio", &Window::SetAspectRatio)
|
||||||
|
.SetMethod("getNativeWindowHandle", &Window::GetNativeWindowHandle)
|
||||||
.SetMethod("getBounds", &Window::GetBounds)
|
.SetMethod("getBounds", &Window::GetBounds)
|
||||||
.SetMethod("setBounds", &Window::SetBounds)
|
.SetMethod("setBounds", &Window::SetBounds)
|
||||||
.SetMethod("getSize", &Window::GetSize)
|
.SetMethod("getSize", &Window::GetSize)
|
||||||
|
|
|
@ -137,6 +137,7 @@ class Window : public mate::TrackableObject<Window>,
|
||||||
void SetMenuBarVisibility(bool visible);
|
void SetMenuBarVisibility(bool visible);
|
||||||
bool IsMenuBarVisible();
|
bool IsMenuBarVisible();
|
||||||
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
|
||||||
|
v8::Local<v8::Value> GetNativeWindowHandle();
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
typedef base::Callback<void(v8::Local<v8::Value>,
|
typedef base::Callback<void(v8::Local<v8::Value>,
|
||||||
|
|
|
@ -143,6 +143,7 @@ class NativeWindow : public base::SupportsUserData,
|
||||||
virtual void SetMenu(ui::MenuModel* menu);
|
virtual void SetMenu(ui::MenuModel* menu);
|
||||||
virtual bool HasModalDialog();
|
virtual bool HasModalDialog();
|
||||||
virtual gfx::NativeWindow GetNativeWindow() = 0;
|
virtual gfx::NativeWindow GetNativeWindow() = 0;
|
||||||
|
virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
|
||||||
|
|
||||||
// Taskbar/Dock APIs.
|
// Taskbar/Dock APIs.
|
||||||
virtual void SetProgressBar(double progress) = 0;
|
virtual void SetProgressBar(double progress) = 0;
|
||||||
|
|
|
@ -65,6 +65,7 @@ class NativeWindowMac : public NativeWindow {
|
||||||
void SetIgnoreMouseEvents(bool ignore) override;
|
void SetIgnoreMouseEvents(bool ignore) override;
|
||||||
bool HasModalDialog() override;
|
bool HasModalDialog() override;
|
||||||
gfx::NativeWindow GetNativeWindow() override;
|
gfx::NativeWindow GetNativeWindow() override;
|
||||||
|
gfx::AcceleratedWidget GetAcceleratedWidget() override;
|
||||||
void SetProgressBar(double progress) override;
|
void SetProgressBar(double progress) override;
|
||||||
void SetOverlayIcon(const gfx::Image& overlay,
|
void SetOverlayIcon(const gfx::Image& overlay,
|
||||||
const std::string& description) override;
|
const std::string& description) override;
|
||||||
|
|
|
@ -731,6 +731,10 @@ gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
|
||||||
return window_;
|
return window_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() {
|
||||||
|
return window_;
|
||||||
|
}
|
||||||
|
|
||||||
void NativeWindowMac::SetProgressBar(double progress) {
|
void NativeWindowMac::SetProgressBar(double progress) {
|
||||||
NSDockTile* dock_tile = [NSApp dockTile];
|
NSDockTile* dock_tile = [NSApp dockTile];
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ class NativeWindowViews : public NativeWindow,
|
||||||
void SetVisibleOnAllWorkspaces(bool visible) override;
|
void SetVisibleOnAllWorkspaces(bool visible) override;
|
||||||
bool IsVisibleOnAllWorkspaces() override;
|
bool IsVisibleOnAllWorkspaces() override;
|
||||||
|
|
||||||
gfx::AcceleratedWidget GetAcceleratedWidget();
|
gfx::AcceleratedWidget GetAcceleratedWidget() override;
|
||||||
|
|
||||||
views::Widget* widget() const { return window_.get(); }
|
views::Widget* widget() const { return window_.get(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue