| 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 <tchar.h> | 10 #include <tchar.h> |
| 11 | 11 |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
| 16 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "base/time/time.h" |
| 21 #include "base/trace_event/trace_event.h" | 22 #include "base/trace_event/trace_event.h" |
| 22 #include "base/win/scoped_gdi_object.h" | 23 #include "base/win/scoped_gdi_object.h" |
| 23 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 24 #include "ui/base/view_prop.h" | 25 #include "ui/base/view_prop.h" |
| 25 #include "ui/base/win/internal_constants.h" | 26 #include "ui/base/win/internal_constants.h" |
| 26 #include "ui/base/win/lock_state.h" | 27 #include "ui/base/win/lock_state.h" |
| 27 #include "ui/base/win/mouse_wheel_util.h" | 28 #include "ui/base/win/mouse_wheel_util.h" |
| 28 #include "ui/base/win/shell.h" | 29 #include "ui/base/win/shell.h" |
| 29 #include "ui/base/win/touch_input.h" | 30 #include "ui/base/win/touch_input.h" |
| 30 #include "ui/display/win/dpi.h" | 31 #include "ui/display/win/dpi.h" |
| (...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 if (!ref.get()) | 2161 if (!ref.get()) |
| 2161 return; | 2162 return; |
| 2162 in_size_loop_ = false; | 2163 in_size_loop_ = false; |
| 2163 } | 2164 } |
| 2164 } | 2165 } |
| 2165 | 2166 |
| 2166 void HWNDMessageHandler::OnThemeChanged() { | 2167 void HWNDMessageHandler::OnThemeChanged() { |
| 2167 ui::NativeThemeWin::CloseHandles(); | 2168 ui::NativeThemeWin::CloseHandles(); |
| 2168 } | 2169 } |
| 2169 | 2170 |
| 2171 void HWNDMessageHandler::OnTimeChange() { |
| 2172 // Call NowFromSystemTime() to force base::Time to re-initialize the clock |
| 2173 // from system time. Otherwise base::Time::Now() might continue to reflect the |
| 2174 // old system clock for some amount of time. See https://crbug.com/672906#c5 |
| 2175 base::Time::NowFromSystemTime(); |
| 2176 } |
| 2177 |
| 2170 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, | 2178 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, |
| 2171 WPARAM w_param, | 2179 WPARAM w_param, |
| 2172 LPARAM l_param) { | 2180 LPARAM l_param) { |
| 2173 // Handle touch events only on Aura for now. | 2181 // Handle touch events only on Aura for now. |
| 2174 int num_points = LOWORD(w_param); | 2182 int num_points = LOWORD(w_param); |
| 2175 std::unique_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]); | 2183 std::unique_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]); |
| 2176 if (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param), | 2184 if (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param), |
| 2177 num_points, input.get(), | 2185 num_points, input.get(), |
| 2178 sizeof(TOUCHINPUT))) { | 2186 sizeof(TOUCHINPUT))) { |
| 2179 // input[i].dwTime doesn't necessarily relate to the system time at all, | 2187 // input[i].dwTime doesn't necessarily relate to the system time at all, |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2773 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2781 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
| 2774 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2782 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
| 2775 &monitor_info); | 2783 &monitor_info); |
| 2776 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2784 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
| 2777 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2785 shrunk_rect.set_height(shrunk_rect.height() - 1); |
| 2778 background_fullscreen_hack_ = true; | 2786 background_fullscreen_hack_ = true; |
| 2779 SetBoundsInternal(shrunk_rect, false); | 2787 SetBoundsInternal(shrunk_rect, false); |
| 2780 } | 2788 } |
| 2781 | 2789 |
| 2782 } // namespace views | 2790 } // namespace views |
| OLD | NEW |