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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 12566007: Wrap calls to GetTouchInputInfo (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Correcting namespace references. Created 7 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 unified diff | Download patch
« ui/base/win/touch_input.cc ('K') | « ui/ui.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param),
1929 num_points, input.get(), sizeof(TOUCHINPUT))) { 1930 num_points, input.get(),
1931 sizeof(TOUCHINPUT))) {
1930 for (int i = 0; i < num_points; ++i) { 1932 for (int i = 0; i < num_points; ++i) {
1931 ui::EventType touch_event_type = ui::ET_UNKNOWN; 1933 ui::EventType touch_event_type = ui::ET_UNKNOWN;
1932 1934
1933 if (input[i].dwFlags & TOUCHEVENTF_DOWN) { 1935 if (input[i].dwFlags & TOUCHEVENTF_DOWN) {
1934 touch_ids_.insert(input[i].dwID); 1936 touch_ids_.insert(input[i].dwID);
1935 touch_event_type = ui::ET_TOUCH_PRESSED; 1937 touch_event_type = ui::ET_TOUCH_PRESSED;
1936 } else if (input[i].dwFlags & TOUCHEVENTF_UP) { 1938 } else if (input[i].dwFlags & TOUCHEVENTF_UP) {
1937 touch_ids_.erase(input[i].dwID); 1939 touch_ids_.erase(input[i].dwID);
1938 touch_event_type = ui::ET_TOUCH_RELEASED; 1940 touch_event_type = ui::ET_TOUCH_RELEASED;
1939 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { 1941 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 DwmExtendFrameIntoClientArea(hwnd(), &m); 2050 DwmExtendFrameIntoClientArea(hwnd(), &m);
2049 } 2051 }
2050 if (window_pos->flags & SWP_SHOWWINDOW) 2052 if (window_pos->flags & SWP_SHOWWINDOW)
2051 delegate_->HandleVisibilityChanged(true); 2053 delegate_->HandleVisibilityChanged(true);
2052 else if (window_pos->flags & SWP_HIDEWINDOW) 2054 else if (window_pos->flags & SWP_HIDEWINDOW)
2053 delegate_->HandleVisibilityChanged(false); 2055 delegate_->HandleVisibilityChanged(false);
2054 SetMsgHandled(FALSE); 2056 SetMsgHandled(FALSE);
2055 } 2057 }
2056 2058
2057 } // namespace views 2059 } // namespace views
OLDNEW
« ui/base/win/touch_input.cc ('K') | « ui/ui.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698