Chromium Code Reviews| 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 <oleacc.h> | 8 #include <oleacc.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
| (...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2421 base::TimeDelta::FromMilliseconds(kTouchDownContextResetTimeout)); | 2421 base::TimeDelta::FromMilliseconds(kTouchDownContextResetTimeout)); |
| 2422 } else if (input[i].dwFlags & TOUCHEVENTF_UP) { | 2422 } else if (input[i].dwFlags & TOUCHEVENTF_UP) { |
| 2423 touch_ids_.erase(input[i].dwID); | 2423 touch_ids_.erase(input[i].dwID); |
| 2424 touch_event_type = ui::ET_TOUCH_RELEASED; | 2424 touch_event_type = ui::ET_TOUCH_RELEASED; |
| 2425 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { | 2425 } else if (input[i].dwFlags & TOUCHEVENTF_MOVE) { |
| 2426 touch_event_type = ui::ET_TOUCH_MOVED; | 2426 touch_event_type = ui::ET_TOUCH_MOVED; |
| 2427 } | 2427 } |
| 2428 if (touch_event_type != ui::ET_UNKNOWN) { | 2428 if (touch_event_type != ui::ET_UNKNOWN) { |
| 2429 base::TimeTicks now; | 2429 base::TimeTicks now; |
| 2430 // input[i].dwTime doesn't necessarily relate to the system time at all, | 2430 // input[i].dwTime doesn't necessarily relate to the system time at all, |
| 2431 // so use base::TimeTicks::HighResNow() if possible, or | 2431 // so use base::TimeTicks::Now() |
| 2432 // base::TimeTicks::Now() otherwise. | 2432 now = base::TimeTicks::Now(); |
|
miu
2015/01/21 23:52:51
nit/clean-up: Remove the declaration (3 lines abov
charliea_google.com
2015/01/22 15:20:46
Done.
| |
| 2433 if (base::TimeTicks::IsHighResNowFastAndReliable()) | |
| 2434 now = base::TimeTicks::HighResNow(); | |
| 2435 else | |
| 2436 now = base::TimeTicks::Now(); | |
| 2437 ui::TouchEvent event(touch_event_type, | 2433 ui::TouchEvent event(touch_event_type, |
| 2438 gfx::Point(point.x, point.y), | 2434 gfx::Point(point.x, point.y), |
| 2439 id_generator_.GetGeneratedID(input[i].dwID), | 2435 id_generator_.GetGeneratedID(input[i].dwID), |
| 2440 now - base::TimeTicks()); | 2436 now - base::TimeTicks()); |
| 2441 event.set_flags(flags); | 2437 event.set_flags(flags); |
| 2442 event.latency()->AddLatencyNumberWithTimestamp( | 2438 event.latency()->AddLatencyNumberWithTimestamp( |
| 2443 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, | 2439 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, |
| 2444 0, | 2440 0, |
| 2445 0, | 2441 0, |
| 2446 base::TimeTicks::FromInternalValue( | 2442 base::TimeTicks::FromInternalValue( |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2759 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2755 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
| 2760 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2756 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
| 2761 } | 2757 } |
| 2762 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2758 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
| 2763 // to notify our children too, since we can have MDI child windows who need to | 2759 // to notify our children too, since we can have MDI child windows who need to |
| 2764 // update their appearance. | 2760 // update their appearance. |
| 2765 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2761 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
| 2766 } | 2762 } |
| 2767 | 2763 |
| 2768 } // namespace views | 2764 } // namespace views |
| OLD | NEW |