window: adding setBounds and getBounds api

This commit is contained in:
deepak1556 2015-05-01 16:20:53 +05:30
parent 4608f5e9cd
commit ae6a1b409f
8 changed files with 54 additions and 0 deletions

View file

@ -470,6 +470,15 @@ bool NativeWindowMac::IsFullscreen() const {
return [window_ styleMask] & NSFullScreenWindowMask;
}
void NativeWindowMac::SetBounds(const gfx::Rect& bounds) {
Move(bounds);
}
gfx::Rect NativeWindowMac::GetBounds() {
return gfx::Rect(GetPosition(),
GetSize());
}
void NativeWindowMac::SetSize(const gfx::Size& size) {
NSRect frame = [window_ frame];
frame.origin.y -= size.height() - frame.size.height;