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) {
return window_->SetVisibleOnAllWorkspaces(visible);
}
.SetMethod("setFullScreen", &Window::SetFullScreen)
.SetMethod("isFullScreen", &Window::IsFullscreen)
.SetMethod("setAspectRatio", &Window::SetAspectRatio)
+ .SetMethod("getNativeWindowHandle", &Window::GetNativeWindowHandle)
.SetMethod("getBounds", &Window::GetBounds)
.SetMethod("setBounds", &Window::SetBounds)
.SetMethod("getSize", &Window::GetSize)
void SetMenuBarVisibility(bool visible);
bool IsMenuBarVisible();
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
+ v8::Local<v8::Value> GetNativeWindowHandle();
#if defined(OS_WIN)
typedef base::Callback<void(v8::Local<v8::Value>,
virtual void SetMenu(ui::MenuModel* menu);
virtual bool HasModalDialog();
virtual gfx::NativeWindow GetNativeWindow() = 0;
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
// Taskbar/Dock APIs.
virtual void SetProgressBar(double progress) = 0;
void SetIgnoreMouseEvents(bool ignore) override;
bool HasModalDialog() override;
gfx::NativeWindow GetNativeWindow() override;
+ gfx::AcceleratedWidget GetAcceleratedWidget() override;
void SetProgressBar(double progress) override;
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description) override;
return window_;
}
+gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() {
+ return window_;
+}
+
void NativeWindowMac::SetProgressBar(double progress) {
NSDockTile* dock_tile = [NSApp dockTile];
void SetVisibleOnAllWorkspaces(bool visible) override;
bool IsVisibleOnAllWorkspaces() override;
- gfx::AcceleratedWidget GetAcceleratedWidget();
+ gfx::AcceleratedWidget GetAcceleratedWidget() override;
views::Widget* widget() const { return window_.get(); }