OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
13 #include "ui/base/events/event.h" | 13 #include "ui/base/events/event.h" |
14 #include "ui/base/events/event_utils.h" | 14 #include "ui/base/events/event_utils.h" |
| 15 #include "ui/base/gestures/gesture_sequence.h" |
15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 16 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
16 #include "ui/base/win/hwnd_util.h" | 17 #include "ui/base/win/hwnd_util.h" |
17 #include "ui/base/win/mouse_wheel_util.h" | 18 #include "ui/base/win/mouse_wheel_util.h" |
18 #include "ui/base/win/shell.h" | 19 #include "ui/base/win/shell.h" |
19 #include "ui/base/win/touch_input.h" | 20 #include "ui/base/win/touch_input.h" |
20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
21 #include "ui/gfx/canvas_skia_paint.h" | 22 #include "ui/gfx/canvas_skia_paint.h" |
22 #include "ui/gfx/icon_util.h" | 23 #include "ui/gfx/icon_util.h" |
23 #include "ui/gfx/insets.h" | 24 #include "ui/gfx/insets.h" |
24 #include "ui/gfx/path.h" | 25 #include "ui/gfx/path.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 286 } |
286 | 287 |
287 return false; | 288 return false; |
288 } | 289 } |
289 | 290 |
290 #endif | 291 #endif |
291 | 292 |
292 // The thickness of an auto-hide taskbar in pixels. | 293 // The thickness of an auto-hide taskbar in pixels. |
293 const int kAutoHideTaskbarThicknessPx = 2; | 294 const int kAutoHideTaskbarThicknessPx = 2; |
294 | 295 |
295 // The touch id to be used for touch events coming in from Windows Aura | |
296 // Desktop. | |
297 const int kDesktopChromeAuraTouchId = 9; | |
298 | |
299 // For windows with the standard frame removed, the client area needs to be | 296 // For windows with the standard frame removed, the client area needs to be |
300 // different from the window area to avoid a "feature" in Windows's handling of | 297 // different from the window area to avoid a "feature" in Windows's handling of |
301 // WM_NCCALCSIZE data. See the comment near the bottom of GetClientAreaInsets | 298 // WM_NCCALCSIZE data. See the comment near the bottom of GetClientAreaInsets |
302 // for more details. | 299 // for more details. |
303 const int kClientAreaBottomInsetHack = -1; | 300 const int kClientAreaBottomInsetHack = -1; |
304 | 301 |
305 } // namespace | 302 } // namespace |
306 | 303 |
307 // A scoping class that prevents a window from being able to redraw in response | 304 // A scoping class that prevents a window from being able to redraw in response |
308 // to invalidations that may occur within it for the lifetime of the object. | 305 // to invalidations that may occur within it for the lifetime of the object. |
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 if (touch_event_type != ui::ET_UNKNOWN) { | 1993 if (touch_event_type != ui::ET_UNKNOWN) { |
1997 POINT point; | 1994 POINT point; |
1998 point.x = TOUCH_COORD_TO_PIXEL(input[i].x); | 1995 point.x = TOUCH_COORD_TO_PIXEL(input[i].x); |
1999 point.y = TOUCH_COORD_TO_PIXEL(input[i].y); | 1996 point.y = TOUCH_COORD_TO_PIXEL(input[i].y); |
2000 | 1997 |
2001 ScreenToClient(hwnd(), &point); | 1998 ScreenToClient(hwnd(), &point); |
2002 | 1999 |
2003 ui::TouchEvent event( | 2000 ui::TouchEvent event( |
2004 touch_event_type, | 2001 touch_event_type, |
2005 gfx::Point(point.x, point.y), | 2002 gfx::Point(point.x, point.y), |
2006 kDesktopChromeAuraTouchId, | 2003 input[i].dwID % ui::GestureSequence::kMaxGesturePoints, |
2007 base::TimeDelta::FromMilliseconds(input[i].dwTime)); | 2004 base::TimeDelta::FromMilliseconds(input[i].dwTime)); |
2008 delegate_->HandleTouchEvent(event); | 2005 delegate_->HandleTouchEvent(event); |
2009 } | 2006 } |
2010 #endif | 2007 #endif |
2011 } | 2008 } |
2012 } | 2009 } |
2013 CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(l_param)); | 2010 CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(l_param)); |
2014 SetMsgHandled(FALSE); | 2011 SetMsgHandled(FALSE); |
2015 return 0; | 2012 return 0; |
2016 } | 2013 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2097 DwmExtendFrameIntoClientArea(hwnd(), &m); |
2101 } | 2098 } |
2102 if (window_pos->flags & SWP_SHOWWINDOW) | 2099 if (window_pos->flags & SWP_SHOWWINDOW) |
2103 delegate_->HandleVisibilityChanged(true); | 2100 delegate_->HandleVisibilityChanged(true); |
2104 else if (window_pos->flags & SWP_HIDEWINDOW) | 2101 else if (window_pos->flags & SWP_HIDEWINDOW) |
2105 delegate_->HandleVisibilityChanged(false); | 2102 delegate_->HandleVisibilityChanged(false); |
2106 SetMsgHandled(FALSE); | 2103 SetMsgHandled(FALSE); |
2107 } | 2104 } |
2108 | 2105 |
2109 } // namespace views | 2106 } // namespace views |
OLD | NEW |