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

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

Issue 1426933002: Refactor Windows DPI Point, Rect, and Size for Multiple Monitor DPI Awareness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 10
(...skipping 14 matching lines...) Expand all
25 #include "ui/events/event_utils.h" 25 #include "ui/events/event_utils.h"
26 #include "ui/events/keycodes/keyboard_code_conversion_win.h" 26 #include "ui/events/keycodes/keyboard_code_conversion_win.h"
27 #include "ui/events/win/system_event_state_lookup.h" 27 #include "ui/events/win/system_event_state_lookup.h"
28 #include "ui/gfx/canvas.h" 28 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/geometry/insets.h" 29 #include "ui/gfx/geometry/insets.h"
30 #include "ui/gfx/icon_util.h" 30 #include "ui/gfx/icon_util.h"
31 #include "ui/gfx/path.h" 31 #include "ui/gfx/path.h"
32 #include "ui/gfx/path_win.h" 32 #include "ui/gfx/path_win.h"
33 #include "ui/gfx/screen.h" 33 #include "ui/gfx/screen.h"
34 #include "ui/gfx/win/direct_manipulation.h" 34 #include "ui/gfx/win/direct_manipulation.h"
35 #include "ui/gfx/win/dpi.h"
36 #include "ui/gfx/win/hwnd_util.h" 35 #include "ui/gfx/win/hwnd_util.h"
37 #include "ui/native_theme/native_theme_win.h" 36 #include "ui/native_theme/native_theme_win.h"
38 #include "ui/views/views_delegate.h" 37 #include "ui/views/views_delegate.h"
39 #include "ui/views/widget/monitor_win.h" 38 #include "ui/views/widget/monitor_win.h"
40 #include "ui/views/widget/widget_hwnd_utils.h" 39 #include "ui/views/widget/widget_hwnd_utils.h"
41 #include "ui/views/win/fullscreen_handler.h" 40 #include "ui/views/win/fullscreen_handler.h"
42 #include "ui/views/win/hwnd_message_handler_delegate.h" 41 #include "ui/views/win/hwnd_message_handler_delegate.h"
43 #include "ui/views/win/scoped_fullscreen_visibility.h" 42 #include "ui/views/win/scoped_fullscreen_visibility.h"
44 #include "ui/views/win/windows_session_change_observer.h" 43 #include "ui/views/win/windows_session_change_observer.h"
45 44
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 // to add the scroll styles back to ensure that scrolling works in legacy 1363 // to add the scroll styles back to ensure that scrolling works in legacy
1365 // trackpoint drivers. 1364 // trackpoint drivers.
1366 if (in_size_loop_ && needs_scroll_styles_) 1365 if (in_size_loop_ && needs_scroll_styles_)
1367 AddScrollStylesToWindow(hwnd()); 1366 AddScrollStylesToWindow(hwnd());
1368 } 1367 }
1369 1368
1370 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { 1369 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) {
1371 gfx::Size min_window_size; 1370 gfx::Size min_window_size;
1372 gfx::Size max_window_size; 1371 gfx::Size max_window_size;
1373 delegate_->GetMinMaxSize(&min_window_size, &max_window_size); 1372 delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
1374 min_window_size = gfx::win::DIPToScreenSize(min_window_size); 1373 min_window_size = delegate_->DIPToScreenSize(min_window_size);
1375 max_window_size = gfx::win::DIPToScreenSize(max_window_size); 1374 max_window_size = delegate_->DIPToScreenSize(max_window_size);
1376 1375
1377 1376
1378 // Add the native frame border size to the minimum and maximum size if the 1377 // Add the native frame border size to the minimum and maximum size if the
1379 // view reports its size as the client size. 1378 // view reports its size as the client size.
1380 if (delegate_->WidgetSizeIsClientSize()) { 1379 if (delegate_->WidgetSizeIsClientSize()) {
1381 RECT client_rect, window_rect; 1380 RECT client_rect, window_rect;
1382 GetClientRect(hwnd(), &client_rect); 1381 GetClientRect(hwnd(), &client_rect);
1383 GetWindowRect(hwnd(), &window_rect); 1382 GetWindowRect(hwnd(), &window_rect);
1384 CR_DEFLATE_RECT(&window_rect, &client_rect); 1383 CR_DEFLATE_RECT(&window_rect, &client_rect);
1385 min_window_size.Enlarge(window_rect.right - window_rect.left, 1384 min_window_size.Enlarge(window_rect.right - window_rect.left,
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 2459 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
2461 0, 2460 0,
2462 0, 2461 0,
2463 event_time, 2462 event_time,
2464 1); 2463 1);
2465 2464
2466 touch_events->push_back(event); 2465 touch_events->push_back(event);
2467 } 2466 }
2468 2467
2469 } // namespace views 2468 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698