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

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

Issue 2628423002: Call base::Time::NowFromSystemTime() on WM_TIMECHANGE (Closed)
Patch Set: fix base/time include Created 3 years, 11 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
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('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 <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
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
2175 // https://bugs.chromium.org/p/chromium/issues/detail?id=672906#c5
msw 2017/01/17 19:26:32 nit: shorten url: crbug.com/672906#c5 (optionally
estark 2017/01/18 00:21:12 Done.
2176 base::Time::NowFromSystemTime();
2177 }
2178
2170 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message, 2179 LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
2171 WPARAM w_param, 2180 WPARAM w_param,
2172 LPARAM l_param) { 2181 LPARAM l_param) {
2173 // Handle touch events only on Aura for now. 2182 // Handle touch events only on Aura for now.
2174 int num_points = LOWORD(w_param); 2183 int num_points = LOWORD(w_param);
2175 std::unique_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]); 2184 std::unique_ptr<TOUCHINPUT[]> input(new TOUCHINPUT[num_points]);
2176 if (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param), 2185 if (ui::GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param),
2177 num_points, input.get(), 2186 num_points, input.get(),
2178 sizeof(TOUCHINPUT))) { 2187 sizeof(TOUCHINPUT))) {
2179 // input[i].dwTime doesn't necessarily relate to the system time at all, 2188 // 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
2773 MONITORINFO monitor_info = {sizeof(monitor_info)}; 2782 MONITORINFO monitor_info = {sizeof(monitor_info)};
2774 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), 2783 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
2775 &monitor_info); 2784 &monitor_info);
2776 gfx::Rect shrunk_rect(monitor_info.rcMonitor); 2785 gfx::Rect shrunk_rect(monitor_info.rcMonitor);
2777 shrunk_rect.set_height(shrunk_rect.height() - 1); 2786 shrunk_rect.set_height(shrunk_rect.height() - 1);
2778 background_fullscreen_hack_ = true; 2787 background_fullscreen_hack_ = true;
2779 SetBoundsInternal(shrunk_rect, false); 2788 SetBoundsInternal(shrunk_rect, false);
2780 } 2789 }
2781 2790
2782 } // namespace views 2791 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698