summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/constrained_window_impl.cc10
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.cc8
-rw-r--r--chrome/browser/views/frame/aero_glass_non_client_view.h2
-rw-r--r--chrome/views/non_client_view.h7
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.