Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: ash/wm/frame_border_hit_test_controller.cc

Issue 189463013: [Refactor] Move code for painting the window header for browser windows out of ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698