views: Use the quicker way of return content size

Converting content size to window size on high DPI systems will lose
percise and have 1px offset sometimes.
This commit is contained in:
Cheng Zhao 2015-10-05 20:03:43 +08:00
parent 279407f7a3
commit a9b0111c3e
2 changed files with 5 additions and 0 deletions

View file

@ -442,6 +442,10 @@ gfx::Rect NativeWindowViews::GetBounds() {
return window_->GetWindowBoundsInScreen();
}
gfx::Size NativeWindowViews::GetContentSize() {
return web_view_->size();
}
void NativeWindowViews::SetResizable(bool resizable) {
#if defined(OS_WIN)
// WS_MAXIMIZEBOX => Maximize button

View file

@ -63,6 +63,7 @@ class NativeWindowViews : public NativeWindow,
bool IsFullscreen() const override;
void SetBounds(const gfx::Rect& bounds) override;
gfx::Rect GetBounds() override;
gfx::Size GetContentSize() override;
void SetResizable(bool resizable) override;
bool IsResizable() override;
void SetAlwaysOnTop(bool top) override;