Chromium Code Reviews| Index: ui/views/win/hwnd_message_handler.cc |
| diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
| index d8c14ee9b2776f12091f4af804e3da9a69df6ff0..1f46bee037715ff06489ff330b35ed3ee4d2e076 100644 |
| --- a/ui/views/win/hwnd_message_handler.cc |
| +++ b/ui/views/win/hwnd_message_handler.cc |
| @@ -28,6 +28,7 @@ |
| #include "ui/base/win/mouse_wheel_util.h" |
| #include "ui/base/win/shell.h" |
| #include "ui/base/win/touch_input.h" |
| +#include "ui/display/win/dpi.h" |
| #include "ui/events/event.h" |
| #include "ui/events/event_utils.h" |
| #include "ui/events/keycodes/keyboard_code_conversion_win.h" |
| @@ -1395,6 +1396,17 @@ LRESULT HWNDMessageHandler::OnDwmCompositionChanged(UINT msg, |
| return 0; |
| } |
| +LRESULT HWNDMessageHandler::OnDpiChanged(UINT msg, |
| + WPARAM w_param, |
| + LPARAM l_param) { |
| + // We assume square-style scaling factors. |
| + DCHECK_EQ(LOWORD(w_param), HIWORD(w_param)); |
|
sky
2016/06/27 19:09:22
Is this DCHECK really worthwhile? Presumably folks
robliao
2016/06/27 19:40:34
The DCHECK is only worthwhile to the extent that t
|
| + SetBoundsInternal(gfx::Rect(*reinterpret_cast<RECT*>(l_param)), false); |
| + delegate_->HandleWindowScaleFactorChanged( |
| + display::win::GetScalingFactorFromDPI(LOWORD(w_param))); |
| + return 0; |
| +} |
| + |
| void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) { |
| if (menu_depth_++ == 0) |
| delegate_->HandleMenuLoop(true); |