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> |
(...skipping 10 matching lines...) Expand all Loading... |
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 Loading... |
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 if (LOWORD(w_param) != HIWORD(w_param)) |
| 1403 NOTIMPLEMENTED() << "Received non-square scaling factors"; |
| 1404 |
| 1405 SetBoundsInternal(gfx::Rect(*reinterpret_cast<RECT*>(l_param)), false); |
| 1406 delegate_->HandleWindowScaleFactorChanged( |
| 1407 display::win::GetScalingFactorFromDPI(LOWORD(w_param))); |
| 1408 return 0; |
| 1409 } |
| 1410 |
1398 void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) { | 1411 void HWNDMessageHandler::OnEnterMenuLoop(BOOL from_track_popup_menu) { |
1399 if (menu_depth_++ == 0) | 1412 if (menu_depth_++ == 0) |
1400 delegate_->HandleMenuLoop(true); | 1413 delegate_->HandleMenuLoop(true); |
1401 } | 1414 } |
1402 | 1415 |
1403 void HWNDMessageHandler::OnEnterSizeMove() { | 1416 void HWNDMessageHandler::OnEnterSizeMove() { |
1404 // Please refer to the comments in the OnSize function about the scrollbar | 1417 // Please refer to the comments in the OnSize function about the scrollbar |
1405 // hack. | 1418 // hack. |
1406 // Hide the Windows scrollbar if the scroll styles are present to ensure | 1419 // Hide the Windows scrollbar if the scroll styles are present to ensure |
1407 // that a paint flicker does not occur while sizing. | 1420 // that a paint flicker does not occur while sizing. |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2749 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
2737 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2750 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
2738 &monitor_info); | 2751 &monitor_info); |
2739 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2752 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
2740 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2753 shrunk_rect.set_height(shrunk_rect.height() - 1); |
2741 background_fullscreen_hack_ = true; | 2754 background_fullscreen_hack_ = true; |
2742 SetBoundsInternal(shrunk_rect, false); | 2755 SetBoundsInternal(shrunk_rect, false); |
2743 } | 2756 } |
2744 | 2757 |
2745 } // namespace views | 2758 } // namespace views |
OLD | NEW |