return window_->GetBounds();
}
+gfx::Rect Window::GetContentBounds() {
+ return window_->GetContentBounds();
+}
+
void Window::SetSize(int width, int height, mate::Arguments* args) {
bool animate = false;
args->GetNext(&animate);
.SetMethod("setBounds", &Window::SetBounds)
.SetMethod("getSize", &Window::GetSize)
.SetMethod("setSize", &Window::SetSize)
+ .SetMethod("getContentBounds", &Window::GetContentBounds)
.SetMethod("getContentSize", &Window::GetContentSize)
.SetMethod("setContentSize", &Window::SetContentSize)
.SetMethod("setMinimumSize", &Window::SetMinimumSize)
std::vector<int> GetSize();
void SetContentSize(int width, int height, mate::Arguments* args);
std::vector<int> GetContentSize();
+ gfx::Rect GetContentBounds();
void SetMinimumSize(int width, int height);
std::vector<int> GetMinimumSize();
void SetMaximumSize(int width, int height);
virtual gfx::Point GetPosition();
virtual void SetContentSize(const gfx::Size& size, bool animate = false);
virtual gfx::Size GetContentSize();
+ virtual gfx::Rect GetContentBounds() = 0;
virtual void SetSizeConstraints(
const extensions::SizeConstraints& size_constraints);
virtual extensions::SizeConstraints GetSizeConstraints();
bool IsFullscreen() const override;
void SetBounds(const gfx::Rect& bounds, bool animate = false) override;
gfx::Rect GetBounds() override;
+ gfx::Rect GetContentBounds() override;
void SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints) override;
void SetResizable(bool resizable) override;
return bounds;
}
+gfx::Rect NativeWindowMac::GetContentBounds() {
+ NSRect frame = [window_ convertRectToScreen:[[window_ contentView] frame]];
+ gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
+ bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
+ return bounds;
+}
+
void NativeWindowMac::SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints) {
auto convertSize = [this](const gfx::Size& size) {
return window_->GetWindowBoundsInScreen();
}
+gfx::Rect NativeWindowViews::GetContentBounds() {
+ return window_->GetClientAreaBoundsInScreen();
+}
+
gfx::Size NativeWindowViews::GetContentSize() {
#if defined(OS_WIN)
if (IsMinimized())
bool IsFullscreen() const override;
void SetBounds(const gfx::Rect& bounds, bool animate) override;
gfx::Rect GetBounds() override;
+ gfx::Rect GetContentBounds() override;
gfx::Size GetContentSize() override;
void SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints) override;