diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 01:57:46 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 01:57:46 +0000 |
commit | 60142d98de42fad6bc63b37b063d565a3ab85f0b (patch) | |
tree | 8c6da770085cddce1fb1baccdeb9a614d946bfb7 | |
parent | 8565f949578562274e33b7182cd38667de34d844 (diff) | |
download | chromium_src-60142d98de42fad6bc63b37b063d565a3ab85f0b.zip chromium_src-60142d98de42fad6bc63b37b063d565a3ab85f0b.tar.gz chromium_src-60142d98de42fad6bc63b37b063d565a3ab85f0b.tar.bz2 |
Fix UI test regression, there's a better way to refactor this anyway.
TBR=glen
Review URL: http://codereview.chromium.org/24007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9443 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.h | 2 | ||||
-rw-r--r-- | chrome/views/non_client_view.h | 7 |
4 files changed, 22 insertions, 5 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 31e7fa4..7d5faa1 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -199,6 +199,8 @@ class ConstrainedWindowNonClientView // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; + virtual gfx::Size CalculateWindowSizeForClientSize(int width, + int height) const; virtual CPoint GetSystemMenuPoint() const; virtual int NonClientHitTest(const gfx::Point& point); virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); @@ -343,6 +345,14 @@ gfx::Rect ConstrainedWindowNonClientView::CalculateClientAreaBounds( std::max(0, height - top_height - border_thickness)); } +gfx::Size ConstrainedWindowNonClientView::CalculateWindowSizeForClientSize( + int width, + int height) const { + int border_thickness = NonClientBorderThickness(); + return gfx::Size(width + (2 * border_thickness), + height + NonClientTopBorderHeight() + border_thickness); +} + CPoint ConstrainedWindowNonClientView::GetSystemMenuPoint() const { // Doesn't matter what we return, since this is only used when the user clicks // a window icon, and we never have an icon. diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc index ecb80d6..82bccfc 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.cc +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -158,6 +158,14 @@ gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int width, std::max(0, height - top_height - border_thickness)); } +gfx::Size AeroGlassNonClientView::CalculateWindowSizeForClientSize( + int width, + int height) const { + int border_thickness = NonClientBorderThickness(); + return gfx::Size(width + (2 * border_thickness), + height + NonClientTopBorderHeight() + border_thickness); +} + CPoint AeroGlassNonClientView::GetSystemMenuPoint() const { CPoint offset; MapWindowPoints(GetWidget()->GetHWND(), HWND_DESKTOP, &offset, 1); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h index ce4e38b..68ef83c 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.h +++ b/chrome/browser/views/frame/aero_glass_non_client_view.h @@ -25,6 +25,8 @@ class AeroGlassNonClientView : public views::NonClientView { protected: // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; + virtual gfx::Size CalculateWindowSizeForClientSize(int width, + int height) const; virtual CPoint GetSystemMenuPoint() const; virtual int NonClientHitTest(const gfx::Point& point); virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { } diff --git a/chrome/views/non_client_view.h b/chrome/views/non_client_view.h index debe22a..29cbda3 100644 --- a/chrome/views/non_client_view.h +++ b/chrome/views/non_client_view.h @@ -37,12 +37,9 @@ class NonClientView : public View { int height) const = 0; // Calculates the size of window required to display a client area of the - // specified width and height. Only views used by CustomFrameWindow need - // implement this. + // specified width and height. virtual gfx::Size CalculateWindowSizeForClientSize(int width, - int height) const { - return gfx::Size(); - } + int height) const = 0; // Returns the point, in screen coordinates, where the system menu should // be shown so it shows up anchored to the system menu icon. |