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

Unified Diff: mash/wm/frame/frame_border_hit_test_controller.cc

Issue 1459653002: Gets mustash frames looking like that of ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test Created 5 years, 1 month 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
« no previous file with comments | « mash/wm/frame/frame_border_hit_test_controller.h ('k') | mash/wm/frame/header_painter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/frame/frame_border_hit_test_controller.cc
diff --git a/ash/frame/frame_border_hit_test_controller.cc b/mash/wm/frame/frame_border_hit_test_controller.cc
similarity index 60%
copy from ash/frame/frame_border_hit_test_controller.cc
copy to mash/wm/frame/frame_border_hit_test_controller.cc
index 856933fbdd579a0b0206759f28a97cd44cfd4954..cd233f8486365dfef2cf344f561aacfb125b0f7e 100644
--- a/ash/frame/frame_border_hit_test_controller.cc
+++ b/mash/wm/frame/frame_border_hit_test_controller.cc
@@ -1,32 +1,31 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/frame/frame_border_hit_test_controller.h"
+#include "mash/wm/frame/frame_border_hit_test_controller.h"
-#include "ash/ash_constants.h"
-#include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
-#include "ash/wm/resize_handle_window_targeter.h"
-#include "ash/wm/window_state_observer.h"
+#include "mash/wm/frame/caption_buttons/frame_caption_button_container_view.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
-#include "ui/aura/window_observer.h"
-#include "ui/aura/window_targeter.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/non_client_view.h"
-namespace ash {
+namespace mash {
+namespace wm {
-FrameBorderHitTestController::FrameBorderHitTestController(views::Widget* frame)
- : frame_window_(frame->GetNativeWindow()) {
- frame_window_->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
- new ResizeHandleWindowTargeter(frame_window_, NULL)));
-}
+// In the window corners, the resize areas don't actually expand bigger, but the
+// 16 px at the end of each edge triggers diagonal resizing.
+const int kResizeAreaCornerSize = 16;
-FrameBorderHitTestController::~FrameBorderHitTestController() {
-}
+// Windows do not have a traditional visible window frame. Window content
+// extends to the edge of the window. We consider a small region outside the
+// window bounds and an even smaller region overlapping the window to be the
+// "non-client" area and use it for resizing.
+const int kResizeOutsideBoundsSize = 6;
+const int kResizeOutsideBoundsScaleForTouch = 5;
+const int kResizeInsideBoundsSize = 1;
// static
int FrameBorderHitTestController::NonClientHitTest(
@@ -54,24 +53,21 @@ int FrameBorderHitTestController::NonClientHitTest(
resize_border = 0;
can_ever_resize = false;
}
- int frame_component = view->GetHTComponentForFrame(point_in_widget,
- resize_border,
- resize_border,
- kResizeAreaCornerSize,
- kResizeAreaCornerSize,
- can_ever_resize);
+ int frame_component = view->GetHTComponentForFrame(
+ point_in_widget, resize_border, resize_border, kResizeAreaCornerSize,
+ kResizeAreaCornerSize, can_ever_resize);
if (frame_component != HTNOWHERE)
return frame_component;
- int client_component = frame->client_view()->NonClientHitTest(
- point_in_widget);
+ int client_component =
+ frame->client_view()->NonClientHitTest(point_in_widget);
if (client_component != HTNOWHERE)
return client_component;
if (caption_button_container->visible()) {
gfx::Point point_in_caption_button_container(point_in_widget);
views::View::ConvertPointFromWidget(caption_button_container,
- &point_in_caption_button_container);
+ &point_in_caption_button_container);
int caption_button_component = caption_button_container->NonClientHitTest(
point_in_caption_button_container);
if (caption_button_component != HTNOWHERE)
@@ -82,4 +78,5 @@ int FrameBorderHitTestController::NonClientHitTest(
return HTCAPTION;
}
-} // namespace ash
+} // namespace wm
+} // namespace mash
« no previous file with comments | « mash/wm/frame/frame_border_hit_test_controller.h ('k') | mash/wm/frame/header_painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698