Chromium Code Reviews| Index: ash/wm/frame_border_hit_test_controller.cc |
| diff --git a/ash/wm/frame_border_hit_test_controller.cc b/ash/wm/frame_border_hit_test_controller.cc |
| index 238a977b51e96b3fd97b2f817ba1fd70163360c0..7a505e6409db6ebb34e292d24c3a12e03e1e6c42 100644 |
| --- a/ash/wm/frame_border_hit_test_controller.cc |
| +++ b/ash/wm/frame_border_hit_test_controller.cc |
| @@ -5,7 +5,7 @@ |
| #include "ash/wm/frame_border_hit_test_controller.h" |
| #include "ash/ash_constants.h" |
| -#include "ash/wm/header_painter.h" |
| +#include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
| #include "ash/wm/resize_handle_window_targeter.h" |
| #include "ash/wm/window_state_observer.h" |
| #include "ui/aura/env.h" |
| @@ -31,7 +31,7 @@ FrameBorderHitTestController::~FrameBorderHitTestController() { |
| // static |
| int FrameBorderHitTestController::NonClientHitTest( |
| views::NonClientFrameView* view, |
| - HeaderPainter* header_painter, |
| + FrameCaptionButtonContainerView* caption_button_container, |
| const gfx::Point& point) { |
|
James Cook
2014/03/10 17:32:30
optional cleanup: maybe point_in_widget?
|
| gfx::Rect expanded_bounds = view->bounds(); |
| int outside_bounds = kResizeOutsideBoundsSize; |
| @@ -65,7 +65,18 @@ int FrameBorderHitTestController::NonClientHitTest( |
| if (client_component != HTNOWHERE) |
| return client_component; |
| - return header_painter->NonClientHitTest(point); |
| + if (caption_button_container->visible()) { |
| + gfx::Point point_in_caption_button_container(point); |
| + views::View::ConvertPointFromWidget(caption_button_container, |
| + &point_in_caption_button_container); |
| + int component = caption_button_container->NonClientHitTest( |
| + point_in_caption_button_container); |
| + if (component != HTNOWHERE) |
| + return component; |
| + } |
| + |
| + // Caption is a safe default. |
| + return HTCAPTION; |
| } |
| } // namespace ash |