return result;
}
+void Window::SetContentSize(int width, int height) {
+ window_->SetContentSize(gfx::Size(width, height));
+}
+
std::vector<int> Window::GetContentSize() {
std::vector<int> result(2);
gfx::Size size = window_->GetContentSize();
.SetMethod("setFullScreen", &Window::SetFullscreen)
.SetMethod("isFullScreen", &Window::IsFullscreen)
.SetMethod("getSize", &Window::GetSize)
- .SetMethod("getContentSize", &Window::GetContentSize)
.SetMethod("setSize", &Window::SetSize)
+ .SetMethod("getContentSize", &Window::GetContentSize)
+ .SetMethod("setContentSize", &Window::SetContentSize)
.SetMethod("setMinimumSize", &Window::SetMinimumSize)
.SetMethod("getMinimumSize", &Window::GetMinimumSize)
.SetMethod("setMaximumSize", &Window::SetMaximumSize)
bool IsFullscreen();
void SetSize(int width, int height);
std::vector<int> GetSize();
+ void SetContentSize(int width, int height);
std::vector<int> GetContentSize();
void SetMinimumSize(int width, int height);
std::vector<int> GetMinimumSize();
virtual bool IsFullscreen() = 0;
virtual void SetSize(const gfx::Size& size) = 0;
virtual gfx::Size GetSize() = 0;
+ virtual void SetContentSize(const gfx::Size& size) = 0;
virtual gfx::Size GetContentSize() = 0;
virtual void SetMinimumSize(const gfx::Size& size) = 0;
virtual gfx::Size GetMinimumSize() = 0;
return gfx::Size(frame_extents.width, frame_extents.height);
}
+void NativeWindowGtk::SetContentSize(const gfx::Size& size) {
+ GtkAllocation size = { 0, 0, size.width(), size.height() };
+ gtk_widget_size_allocate(GetWebContents()->GetView()->GetNativeView(), &size);
+}
+
gfx::Size NativeWindowGtk::GetContentSize() {
gint width, height;
gtk_window_get_size(window_, &width, &height);
virtual bool IsFullscreen() OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
+ virtual void SetContentSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetContentSize() OVERRIDE;
virtual void SetMinimumSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
virtual bool IsFullscreen() OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
+ virtual void SetContentSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetContentSize() OVERRIDE;
virtual void SetMinimumSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
return gfx::Size(frame.size.width, frame.size.height);
}
+void NativeWindowMac::SetContentSize(const gfx::Size& size) {
+ NSRect frame_nsrect = [window_ frame];
+ NSSize frame = frame_nsrect.size;
+ NSSize content = [window_ contentRectForFrameRect:frame_nsrect].size;
+
+ int width = size.width() + frame.width - content.width;
+ int height = size.height() + frame.height - content.height;
+ frame_nsrect.origin.y -= height - frame_nsrect.size.height;
+ frame_nsrect.size.width = width;
+ frame_nsrect.size.height = height;
+ [window_ setFrame:frame_nsrect display:YES];
+}
+
gfx::Size NativeWindowMac::GetContentSize() {
NSRect bounds = [[window_ contentView] bounds];
return gfx::Size(bounds.size.width, bounds.size.height);
return window_->GetWindowBoundsInScreen().size();
}
+void NativeWindowWin::SetContentSize(const gfx::Size& size) {
+ // FIXME
+}
+
gfx::Size NativeWindowWin::GetContentSize() {
return window_->GetClientAreaBoundsInScreen().size();
}
virtual bool IsFullscreen() OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
+ virtual void SetContentSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetContentSize() OVERRIDE;
virtual void SetMinimumSize(const gfx::Size& size) OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;