| 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/keycodes/keyboard_code_conversion_win.h" | 15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
| 16 #include "ui/base/win/hwnd_util.h" | 16 #include "ui/base/win/hwnd_util.h" |
| 17 #include "ui/base/win/mouse_wheel_util.h" | 17 #include "ui/base/win/mouse_wheel_util.h" |
| 18 #include "ui/base/win/shell.h" | 18 #include "ui/base/win/shell.h" |
| 19 #include "ui/base/win/touch_input.h" |
| 19 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 20 #include "ui/gfx/canvas_skia_paint.h" | 21 #include "ui/gfx/canvas_skia_paint.h" |
| 21 #include "ui/gfx/icon_util.h" | 22 #include "ui/gfx/icon_util.h" |
| 22 #include "ui/gfx/insets.h" | 23 #include "ui/gfx/insets.h" |
| 23 #include "ui/gfx/path.h" | 24 #include "ui/gfx/path.h" |
| 24 #include "ui/gfx/path_win.h" | 25 #include "ui/gfx/path_win.h" |
| 25 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
| 26 #include "ui/native_theme/native_theme_win.h" | 27 #include "ui/native_theme/native_theme_win.h" |
| 27 #include "ui/views/views_delegate.h" | 28 #include "ui/views/views_delegate.h" |
| 28 #include "ui/views/widget/monitor_win.h" | 29 #include "ui/views/widget/monitor_win.h" |
| (...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 | 1919 |
| 1919 void HWNDMessageHandler::OnThemeChanged() { | 1920 void HWNDMessageHandler::OnThemeChanged() { |
| 1920 ui::NativeThemeWin::instance()->CloseHandles(); | 1921 ui::NativeThemeWin::instance()->CloseHandles(); |
| 1921 } | 1922 } |
| 1922 | 1923 |
| 1923 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, | 1924 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, |
| 1924 WPARAM w_param, | 1925 WPARAM w_param, |
| 1925 LPARAM l_param) { | 1926 LPARAM l_param) { |
| 1926 int num_points = LOWORD(w_param); | 1927 int num_points = LOWORD(w_param); |
| 1927 scoped_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]); | 1928 scoped_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]); |
| 1928 if (GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(l_param), | 1929 if (GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param), |
| 1929 num_points, input.get(), sizeof(TOUCHINPUT))) { | 1930 num_points, input.get(), sizeof(TOUCHINPUT))) { |
| 1930 for (int i = 0; i < num_points; ++i) { | 1931 for (int i = 0; i < num_points; ++i) { |
| 1931 ui::EventType touch_event_type = ui::ET_UNKNOWN; | 1932 ui::EventType touch_event_type = ui::ET_UNKNOWN; |
| 1932 | 1933 |
| 1933 if (input[i].dwFlags & TOUCHEVENTF_DOWN) { | 1934 if (input[i].dwFlags & TOUCHEVENTF_DOWN) { |
| 1934 touch_ids_.insert(input[i].dwID); | 1935 touch_ids_.insert(input[i].dwID); |
| 1935 touch_event_type = ui::ET_TOUCH_PRESSED; | 1936 touch_event_type = ui::ET_TOUCH_PRESSED; |
| 1936 } else if (input[i].dwFlags & TOUCHEVENTF_UP) { | 1937 } else if (input[i].dwFlags & TOUCHEVENTF_UP) { |
| 1937 touch_ids_.erase(input[i].dwID); | 1938 touch_ids_.erase(input[i].dwID); |
| 1938 touch_event_type = ui::ET_TOUCH_RELEASED; | 1939 touch_event_type = ui::ET_TOUCH_RELEASED; |
| 1939 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { | 1940 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2049 DwmExtendFrameIntoClientArea(hwnd(), &m); |
| 2049 } | 2050 } |
| 2050 if (window_pos->flags & SWP_SHOWWINDOW) | 2051 if (window_pos->flags & SWP_SHOWWINDOW) |
| 2051 delegate_->HandleVisibilityChanged(true); | 2052 delegate_->HandleVisibilityChanged(true); |
| 2052 else if (window_pos->flags & SWP_HIDEWINDOW) | 2053 else if (window_pos->flags & SWP_HIDEWINDOW) |
| 2053 delegate_->HandleVisibilityChanged(false); | 2054 delegate_->HandleVisibilityChanged(false); |
| 2054 SetMsgHandled(FALSE); | 2055 SetMsgHandled(FALSE); |
| 2055 } | 2056 } |
| 2056 | 2057 |
| 2057 } // namespace views | 2058 } // namespace views |
| OLD | NEW |