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

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

Issue 2093993003: Add Plumbing for WM_DPICHANGED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screenprepare
Patch Set: Created 4 years, 5 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') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | 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>
(...skipping 10 matching lines...) Expand all
21 #include "base/trace_event/trace_event.h" 21 #include "base/trace_event/trace_event.h"
22 #include "base/win/scoped_gdi_object.h" 22 #include "base/win/scoped_gdi_object.h"
23 #include "base/win/windows_version.h" 23 #include "base/win/windows_version.h"
24 #include "ui/base/touch/touch_enabled.h" 24 #include "ui/base/touch/touch_enabled.h"
25 #include "ui/base/view_prop.h" 25 #include "ui/base/view_prop.h"
26 #include "ui/base/win/internal_constants.h" 26 #include "ui/base/win/internal_constants.h"
27 #include "ui/base/win/lock_state.h" 27 #include "ui/base/win/lock_state.h"
28 #include "ui/base/win/mouse_wheel_util.h" 28 #include "ui/base/win/mouse_wheel_util.h"
29 #include "ui/base/win/shell.h" 29 #include "ui/base/win/shell.h"
30 #include "ui/base/win/touch_input.h" 30 #include "ui/base/win/touch_input.h"
31 #include "ui/display/win/dpi.h"
31 #include "ui/events/event.h" 32 #include "ui/events/event.h"
32 #include "ui/events/event_utils.h" 33 #include "ui/events/event_utils.h"
33 #include "ui/events/keycodes/keyboard_code_conversion_win.h" 34 #include "ui/events/keycodes/keyboard_code_conversion_win.h"
34 #include "ui/events/win/system_event_state_lookup.h" 35 #include "ui/events/win/system_event_state_lookup.h"
35 #include "ui/gfx/canvas.h" 36 #include "ui/gfx/canvas.h"
36 #include "ui/gfx/geometry/insets.h" 37 #include "ui/gfx/geometry/insets.h"
37 #include "ui/gfx/icon_util.h" 38 #include "ui/gfx/icon_util.h"
38 #include "ui/gfx/path.h" 39 #include "ui/gfx/path.h"
39 #include "ui/gfx/path_win.h" 40 #include "ui/gfx/path_win.h"
40 #include "ui/gfx/win/direct_manipulation.h" 41 #include "ui/gfx/win/direct_manipulation.h"
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 LPARAM l_param) { 1389 LPARAM l_param) {
1389 if (!delegate_->HasNonClientView()) { 1390 if (!delegate_->HasNonClientView()) {
1390 SetMsgHandled(FALSE); 1391 SetMsgHandled(FALSE);
1391 return 0; 1392 return 0;
1392 } 1393 }
1393 1394
1394 FrameTypeChanged(); 1395 FrameTypeChanged();
1395 return 0; 1396 return 0;
1396 } 1397 }
1397 1398
1399 LRESULT HWNDMessageHandler::OnDpiChanged(UINT msg,
1400 WPARAM w_param,
1401 LPARAM l_param) {
1402 // We assume square-style scaling factors.
1403 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
1404 SetBoundsInternal(gfx::Rect(*reinterpret_cast<RECT*>(l_param)), false);
1405 delegate_->HandleWindowScaleFactorChanged(
1406 display::win::GetScalingFactorFromDPI(LOWORD(w_param)));
1407 return 0;
1408 }
1409
1398 void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) { 1410 void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) {
1399 if (menu_depth_++ == 0) 1411 if (menu_depth_++ == 0)
1400 delegate_->HandleMenuLoop(true); 1412 delegate_->HandleMenuLoop(true);
1401 } 1413 }
1402 1414
1403 void HWNDMessageHandler::OnEnterSizeMove() { 1415 void HWNDMessageHandler::OnEnterSizeMove() {
1404 // Please refer to the comments in the OnSize function about the scrollbar 1416 // Please refer to the comments in the OnSize function about the scrollbar
1405 // hack. 1417 // hack.
1406 // Hide the Windows scrollbar if the scroll styles are present to ensure 1418 // Hide the Windows scrollbar if the scroll styles are present to ensure
1407 // that a paint flicker does not occur while sizing. 1419 // that a paint flicker does not occur while sizing.
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 MONITORINFO monitor_info = {sizeof(monitor_info)}; 2748 MONITORINFO monitor_info = {sizeof(monitor_info)};
2737 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), 2749 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
2738 &monitor_info); 2750 &monitor_info);
2739 gfx::Rect shrunk_rect(monitor_info.rcMonitor); 2751 gfx::Rect shrunk_rect(monitor_info.rcMonitor);
2740 shrunk_rect.set_height(shrunk_rect.height() - 1); 2752 shrunk_rect.set_height(shrunk_rect.height() - 1);
2741 background_fullscreen_hack_ = true; 2753 background_fullscreen_hack_ = true;
2742 SetBoundsInternal(shrunk_rect, false); 2754 SetBoundsInternal(shrunk_rect, false);
2743 } 2755 }
2744 2756
2745 } // namespace views 2757 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698