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 <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
513 } | 513 } |
514 | 514 |
515 if (show_state) { | 515 if (show_state) { |
516 if (wp.showCmd == SW_SHOWMAXIMIZED) | 516 if (wp.showCmd == SW_SHOWMAXIMIZED) |
517 *show_state = ui::SHOW_STATE_MAXIMIZED; | 517 *show_state = ui::SHOW_STATE_MAXIMIZED; |
518 else if (wp.showCmd == SW_SHOWMINIMIZED) | 518 else if (wp.showCmd == SW_SHOWMINIMIZED) |
519 *show_state = ui::SHOW_STATE_MINIMIZED; | 519 *show_state = ui::SHOW_STATE_MINIMIZED; |
520 else | 520 else |
521 *show_state = ui::SHOW_STATE_NORMAL; | 521 *show_state = ui::SHOW_STATE_NORMAL; |
522 } | 522 } |
523 | |
524 *bounds = ui::win::ScreenToDIPRect(*bounds); | |
kevers
2013/04/19 20:31:42
As it stands, this change will break Win-Aura, whi
girard
2013/06/03 22:31:55
I've moved this up to the caller (NativeWidgetWin:
| |
523 } | 525 } |
524 | 526 |
525 void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds) { | 527 void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds) { |
526 LONG style = GetWindowLong(hwnd(), GWL_STYLE); | 528 LONG style = GetWindowLong(hwnd(), GWL_STYLE); |
527 if (style & WS_MAXIMIZE) | 529 if (style & WS_MAXIMIZE) |
528 SetWindowLong(hwnd(), GWL_STYLE, style & ~WS_MAXIMIZE); | 530 SetWindowLong(hwnd(), GWL_STYLE, style & ~WS_MAXIMIZE); |
529 SetWindowPos(hwnd(), NULL, bounds.x(), bounds.y(), bounds.width(), | 531 SetWindowPos(hwnd(), NULL, bounds.x(), bounds.y(), bounds.width(), |
530 bounds.height(), SWP_NOACTIVATE | SWP_NOZORDER); | 532 bounds.height(), SWP_NOACTIVATE | SWP_NOZORDER); |
531 } | 533 } |
532 | 534 |
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2108 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2110 DwmExtendFrameIntoClientArea(hwnd(), &m); |
2109 } | 2111 } |
2110 if (window_pos->flags & SWP_SHOWWINDOW) | 2112 if (window_pos->flags & SWP_SHOWWINDOW) |
2111 delegate_->HandleVisibilityChanged(true); | 2113 delegate_->HandleVisibilityChanged(true); |
2112 else if (window_pos->flags & SWP_HIDEWINDOW) | 2114 else if (window_pos->flags & SWP_HIDEWINDOW) |
2113 delegate_->HandleVisibilityChanged(false); | 2115 delegate_->HandleVisibilityChanged(false); |
2114 SetMsgHandled(FALSE); | 2116 SetMsgHandled(FALSE); |
2115 } | 2117 } |
2116 | 2118 |
2117 } // namespace views | 2119 } // namespace views |
OLD | NEW |