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 <wtsapi32.h> | 10 #include <wtsapi32.h> |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 // to add the scroll styles back to ensure that scrolling works in legacy | 1390 // to add the scroll styles back to ensure that scrolling works in legacy |
1391 // trackpoint drivers. | 1391 // trackpoint drivers. |
1392 if (in_size_loop_ && needs_scroll_styles_) | 1392 if (in_size_loop_ && needs_scroll_styles_) |
1393 AddScrollStylesToWindow(hwnd()); | 1393 AddScrollStylesToWindow(hwnd()); |
1394 } | 1394 } |
1395 | 1395 |
1396 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { | 1396 void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { |
1397 gfx::Size min_window_size; | 1397 gfx::Size min_window_size; |
1398 gfx::Size max_window_size; | 1398 gfx::Size max_window_size; |
1399 delegate_->GetMinMaxSize(&min_window_size, &max_window_size); | 1399 delegate_->GetMinMaxSize(&min_window_size, &max_window_size); |
| 1400 min_window_size = gfx::win::DIPToScreenSize(min_window_size); |
| 1401 max_window_size = gfx::win::DIPToScreenSize(max_window_size); |
| 1402 |
1400 | 1403 |
1401 // Add the native frame border size to the minimum and maximum size if the | 1404 // Add the native frame border size to the minimum and maximum size if the |
1402 // view reports its size as the client size. | 1405 // view reports its size as the client size. |
1403 if (delegate_->WidgetSizeIsClientSize()) { | 1406 if (delegate_->WidgetSizeIsClientSize()) { |
1404 RECT client_rect, window_rect; | 1407 RECT client_rect, window_rect; |
1405 GetClientRect(hwnd(), &client_rect); | 1408 GetClientRect(hwnd(), &client_rect); |
1406 GetWindowRect(hwnd(), &window_rect); | 1409 GetWindowRect(hwnd(), &window_rect); |
1407 CR_DEFLATE_RECT(&window_rect, &client_rect); | 1410 CR_DEFLATE_RECT(&window_rect, &client_rect); |
1408 min_window_size.Enlarge(window_rect.right - window_rect.left, | 1411 min_window_size.Enlarge(window_rect.right - window_rect.left, |
1409 window_rect.bottom - window_rect.top); | 1412 window_rect.bottom - window_rect.top); |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2460 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2463 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
2461 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2464 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
2462 } | 2465 } |
2463 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2466 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
2464 // to notify our children too, since we can have MDI child windows who need to | 2467 // to notify our children too, since we can have MDI child windows who need to |
2465 // update their appearance. | 2468 // update their appearance. |
2466 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2469 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
2467 } | 2470 } |
2468 | 2471 |
2469 } // namespace views | 2472 } // namespace views |
OLD | NEW |