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

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: Fixed Other Unit Tests - Moved Inner Classes Outside Created 4 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
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 17 matching lines...) Expand all
28 #include "ui/events/event_utils.h" 28 #include "ui/events/event_utils.h"
29 #include "ui/events/keycodes/keyboard_code_conversion_win.h" 29 #include "ui/events/keycodes/keyboard_code_conversion_win.h"
30 #include "ui/events/win/system_event_state_lookup.h" 30 #include "ui/events/win/system_event_state_lookup.h"
31 #include "ui/gfx/canvas.h" 31 #include "ui/gfx/canvas.h"
32 #include "ui/gfx/geometry/insets.h" 32 #include "ui/gfx/geometry/insets.h"
33 #include "ui/gfx/icon_util.h" 33 #include "ui/gfx/icon_util.h"
34 #include "ui/gfx/path.h" 34 #include "ui/gfx/path.h"
35 #include "ui/gfx/path_win.h" 35 #include "ui/gfx/path_win.h"
36 #include "ui/gfx/screen.h" 36 #include "ui/gfx/screen.h"
37 #include "ui/gfx/win/direct_manipulation.h" 37 #include "ui/gfx/win/direct_manipulation.h"
38 #include "ui/gfx/win/dpi.h"
39 #include "ui/gfx/win/hwnd_util.h" 38 #include "ui/gfx/win/hwnd_util.h"
40 #include "ui/native_theme/native_theme_win.h" 39 #include "ui/native_theme/native_theme_win.h"
41 #include "ui/views/views_delegate.h" 40 #include "ui/views/views_delegate.h"
42 #include "ui/views/widget/monitor_win.h" 41 #include "ui/views/widget/monitor_win.h"
43 #include "ui/views/widget/widget_hwnd_utils.h" 42 #include "ui/views/widget/widget_hwnd_utils.h"
44 #include "ui/views/win/fullscreen_handler.h" 43 #include "ui/views/win/fullscreen_handler.h"
45 #include "ui/views/win/hwnd_message_handler_delegate.h" 44 #include "ui/views/win/hwnd_message_handler_delegate.h"
46 #include "ui/views/win/scoped_fullscreen_visibility.h" 45 #include "ui/views/win/scoped_fullscreen_visibility.h"
47 #include "ui/views/win/windows_session_change_observer.h" 46 #include "ui/views/win/windows_session_change_observer.h"
48 47
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 // to add the scroll styles back to ensure that scrolling works in legacy 1381 // to add the scroll styles back to ensure that scrolling works in legacy
1383 // trackpoint drivers. 1382 // trackpoint drivers.
1384 if (in_size_loop_ && needs_scroll_styles_) 1383 if (in_size_loop_ && needs_scroll_styles_)
1385 AddScrollStylesToWindow(hwnd()); 1384 AddScrollStylesToWindow(hwnd());
1386 } 1385 }
1387 1386
1388 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { 1387 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) {
1389 gfx::Size min_window_size; 1388 gfx::Size min_window_size;
1390 gfx::Size max_window_size; 1389 gfx::Size max_window_size;
1391 delegate_->GetMinMaxSize(&min_window_size, &max_window_size); 1390 delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
1392 min_window_size = gfx::win::DIPToScreenSize(min_window_size); 1391 min_window_size = delegate_->DIPToScreenSize(min_window_size);
1393 max_window_size = gfx::win::DIPToScreenSize(max_window_size); 1392 max_window_size = delegate_->DIPToScreenSize(max_window_size);
1394 1393
1395 1394
1396 // Add the native frame border size to the minimum and maximum size if the 1395 // Add the native frame border size to the minimum and maximum size if the
1397 // view reports its size as the client size. 1396 // view reports its size as the client size.
1398 if (delegate_->WidgetSizeIsClientSize()) { 1397 if (delegate_->WidgetSizeIsClientSize()) {
1399 RECT client_rect, window_rect; 1398 RECT client_rect, window_rect;
1400 GetClientRect(hwnd(), &client_rect); 1399 GetClientRect(hwnd(), &client_rect);
1401 GetWindowRect(hwnd(), &window_rect); 1400 GetWindowRect(hwnd(), &window_rect);
1402 CR_DEFLATE_RECT(&window_rect, &client_rect); 1401 CR_DEFLATE_RECT(&window_rect, &client_rect);
1403 min_window_size.Enlarge(window_rect.right - window_rect.left, 1402 min_window_size.Enlarge(window_rect.right - window_rect.left,
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 2571
2573 default: 2572 default:
2574 left_button_down_on_caption_ = false; 2573 left_button_down_on_caption_ = false;
2575 break; 2574 break;
2576 } 2575 }
2577 return handled; 2576 return handled;
2578 } 2577 }
2579 2578
2580 2579
2581 } // namespace views 2580 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698