Jun Mukai | e29ed1c | 2019-01-29 20:21:23 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "ui/base/hit_test.h" |
| 6 | |
Jun Mukai | e29ed1c | 2019-01-29 20:21:23 | [diff] [blame] | 7 | namespace ui { |
| 8 | |
| 9 | bool IsResizingComponent(int component) { |
| 10 | switch (component) { |
| 11 | case HTBOTTOM: |
| 12 | case HTBOTTOMLEFT: |
| 13 | case HTBOTTOMRIGHT: |
| 14 | case HTLEFT: |
| 15 | case HTRIGHT: |
| 16 | case HTTOP: |
| 17 | case HTTOPLEFT: |
| 18 | case HTTOPRIGHT: |
| 19 | return true; |
| 20 | default: |
| 21 | return false; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | bool CanPerformDragOrResize(int component) { |
| 26 | return component == HTCAPTION || IsResizingComponent(component); |
| 27 | } |
| 28 | |
| 29 | } // namespace ui |