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

Unified Diff: ash/common/frame/frame_border_hit_test.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 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
« no previous file with comments | « ash/common/frame/frame_border_hit_test.h ('k') | ash/common/frame/header_painter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/frame/frame_border_hit_test.cc
diff --git a/ash/common/frame/frame_border_hit_test.cc b/ash/common/frame/frame_border_hit_test.cc
deleted file mode 100644
index 3f0116a13098c0441386aaf893b906a4f6fb6d54..0000000000000000000000000000000000000000
--- a/ash/common/frame/frame_border_hit_test.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2016 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/common/frame/frame_border_hit_test.h"
-
-#include "ash/common/ash_constants.h"
-#include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h"
-#include "ash/common/wm_shell.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 {
-
-int FrameBorderNonClientHitTest(
- views::NonClientFrameView* view,
- FrameCaptionButtonContainerView* caption_button_container,
- const gfx::Point& point_in_widget) {
- gfx::Rect expanded_bounds = view->bounds();
- int outside_bounds = kResizeOutsideBoundsSize;
-
- if (WmShell::Get()->IsTouchDown())
- outside_bounds *= kResizeOutsideBoundsScaleForTouch;
- expanded_bounds.Inset(-outside_bounds, -outside_bounds);
-
- if (!expanded_bounds.Contains(point_in_widget))
- return HTNOWHERE;
-
- // Check the frame first, as we allow a small area overlapping the contents
- // to be used for resize handles.
- views::Widget* frame = view->GetWidget();
- bool can_ever_resize = frame->widget_delegate()->CanResize();
- // Don't allow overlapping resize handles when the window is maximized or
- // fullscreen, as it can't be resized in those states.
- int resize_border = kResizeInsideBoundsSize;
- if (frame->IsMaximized() || frame->IsFullscreen()) {
- resize_border = 0;
- can_ever_resize = false;
- }
- 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);
- 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);
- int caption_button_component = caption_button_container->NonClientHitTest(
- point_in_caption_button_container);
- if (caption_button_component != HTNOWHERE)
- return caption_button_component;
- }
-
- // Caption is a safe default.
- return HTCAPTION;
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/frame/frame_border_hit_test.h ('k') | ash/common/frame/header_painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698