diff options
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/custom_frame_window.cc | 8 | ||||
-rw-r--r-- | chrome/views/non_client_view.cc | 37 | ||||
-rw-r--r-- | chrome/views/non_client_view.h | 7 |
3 files changed, 25 insertions, 27 deletions
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index 8ab4425..25dc089 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -396,7 +396,6 @@ gfx::Rect DefaultNonClientView::CalculateClientAreaBounds(int width, gfx::Size DefaultNonClientView::CalculateWindowSizeForClientSize( int width, int height) const { - int contents_top = CalculateContentsTop(); return gfx::Size(width + (2 * kWindowHorizontalBorderSize), height + CalculateContentsTop() + kWindowVerticalBorderSize); } @@ -447,11 +446,8 @@ int DefaultNonClientView::NonClientHitTest(const gfx::Point& point) { if (button_bounds.Contains(point)) return HTSYSMENU; - component = GetHTComponentForFrame( - point, - kResizeAreaSize, - kResizeAreaCornerSize, - kResizeAreaNorthSize, + component = GetHTComponentForFrame(point, kResizeAreaNorthSize, + kResizeAreaSize, kResizeAreaSize, kResizeAreaCornerSize, container_->window_delegate()->CanResize()); if (component == HTNOWHERE) { // Finally fall back to the caption. diff --git a/chrome/views/non_client_view.cc b/chrome/views/non_client_view.cc index 63fcd34..3e1ebde 100644 --- a/chrome/views/non_client_view.cc +++ b/chrome/views/non_client_view.cc @@ -7,42 +7,43 @@ namespace views { int NonClientView::GetHTComponentForFrame(const gfx::Point& point, - int resize_area_size, - int resize_area_corner_size, - int top_resize_area_size, + int top_resize_border_height, + int resize_border_width, + int bottom_resize_border_height, + int resize_corner_size, bool can_resize) { int component = HTNOWHERE; - if (point.x() < resize_area_size) { - if (point.y() < resize_area_corner_size) { + if (point.x() < resize_border_width) { + if (point.y() < resize_corner_size) { component = HTTOPLEFT; - } else if (point.y() >= (height() - resize_area_corner_size)) { + } else if (point.y() >= (height() - resize_corner_size)) { component = HTBOTTOMLEFT; } else { component = HTLEFT; } - } else if (point.x() < resize_area_corner_size) { - if (point.y() < top_resize_area_size) { + } else if (point.x() < resize_corner_size) { + if (point.y() < top_resize_border_height) { component = HTTOPLEFT; - } else if (point.y() >= (height() - resize_area_size)) { + } else if (point.y() >= (height() - bottom_resize_border_height)) { component = HTBOTTOMLEFT; } - } else if (point.x() >= (width() - resize_area_size)) { - if (point.y() < resize_area_corner_size) { + } else if (point.x() >= (width() - resize_border_width)) { + if (point.y() < resize_corner_size) { component = HTTOPRIGHT; - } else if (point.y() >= (height() - resize_area_corner_size)) { + } else if (point.y() >= (height() - resize_corner_size)) { component = HTBOTTOMRIGHT; - } else if (point.x() >= (width() - resize_area_size)) { + } else { component = HTRIGHT; } - } else if (point.x() >= (width() - resize_area_corner_size)) { - if (point.y() < top_resize_area_size) { + } else if (point.x() >= (width() - resize_corner_size)) { + if (point.y() < top_resize_border_height) { component = HTTOPRIGHT; - } else if (point.y() >= (height() - resize_area_size)) { + } else if (point.y() >= (height() - bottom_resize_border_height)) { component = HTBOTTOMRIGHT; } - } else if (point.y() < top_resize_area_size) { + } else if (point.y() < top_resize_border_height) { component = HTTOP; - } else if (point.y() >= (height() - resize_area_size)) { + } else if (point.y() >= (height() - bottom_resize_border_height)) { component = HTBOTTOM; } diff --git a/chrome/views/non_client_view.h b/chrome/views/non_client_view.h index d8de9ea..3643bbe 100644 --- a/chrome/views/non_client_view.h +++ b/chrome/views/non_client_view.h @@ -75,9 +75,10 @@ class NonClientView : public View { // the size of the sizing edges, and whether or not the window can be // resized. int GetHTComponentForFrame(const gfx::Point& point, - int resize_area_size, - int resize_area_corner_size, - int top_resize_area_size, + int top_resize_border_height, + int resize_border_width, + int bottom_resize_border_height, + int resize_corner_size, bool can_resize); // Accessor for paint_as_active_. |