OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/hwnd_view.h" | 5 #include "views/controls/hwnd_view.h" |
6 | 6 |
7 #include "app/gfx/chrome_canvas.h" | 7 #include "app/gfx/chrome_canvas.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "views/focus/focus_manager.h" | 9 #include "views/focus/focus_manager.h" |
10 #include "views/widget/widget.h" | 10 #include "views/widget/widget.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 SWP_NOACTIVATE | | 103 SWP_NOACTIVATE | |
104 SWP_NOCOPYBITS | | 104 SWP_NOCOPYBITS | |
105 SWP_NOOWNERZORDER | | 105 SWP_NOOWNERZORDER | |
106 SWP_NOZORDER; | 106 SWP_NOZORDER; |
107 // Only send the SHOWWINDOW flag if we're invisible, to avoid flashing. | 107 // Only send the SHOWWINDOW flag if we're invisible, to avoid flashing. |
108 if (!::IsWindowVisible(native_view())) | 108 if (!::IsWindowVisible(native_view())) |
109 swp_flags = (swp_flags | SWP_SHOWWINDOW) & ~SWP_NOREDRAW; | 109 swp_flags = (swp_flags | SWP_SHOWWINDOW) & ~SWP_NOREDRAW; |
110 | 110 |
111 if (fast_resize()) { | 111 if (fast_resize()) { |
112 // In a fast resize, we move the window and clip it with SetWindowRgn. | 112 // In a fast resize, we move the window and clip it with SetWindowRgn. |
113 CRect rect; | 113 RECT win_rect; |
114 GetWindowRect(native_view(), &rect); | 114 GetWindowRect(native_view(), &win_rect); |
115 ::SetWindowPos(native_view(), 0, x, y, rect.Width(), rect.Height(), | 115 gfx::Rect rect(win_rect); |
| 116 ::SetWindowPos(native_view(), 0, x, y, rect.width(), rect.height(), |
116 swp_flags); | 117 swp_flags); |
117 | 118 |
118 HRGN clip_region = CreateRectRgn(0, 0, w, h); | 119 HRGN clip_region = CreateRectRgn(0, 0, w, h); |
119 SetWindowRgn(native_view(), clip_region, FALSE); | 120 SetWindowRgn(native_view(), clip_region, FALSE); |
120 set_installed_clip(true); | 121 set_installed_clip(true); |
121 } else { | 122 } else { |
122 ::SetWindowPos(native_view(), 0, x, y, w, h, swp_flags); | 123 ::SetWindowPos(native_view(), 0, x, y, w, h, swp_flags); |
123 } | 124 } |
124 } | 125 } |
125 | 126 |
126 void HWNDView::HideWidget() { | 127 void HWNDView::HideWidget() { |
127 if (!::IsWindowVisible(native_view())) | 128 if (!::IsWindowVisible(native_view())) |
128 return; // Currently not visible, nothing to do. | 129 return; // Currently not visible, nothing to do. |
129 | 130 |
130 // The window is currently visible, but its clipped by another view. Hide | 131 // The window is currently visible, but its clipped by another view. Hide |
131 // it. | 132 // it. |
132 ::SetWindowPos(native_view(), 0, 0, 0, 0, 0, | 133 ::SetWindowPos(native_view(), 0, 0, 0, 0, 0, |
133 SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | | 134 SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | |
134 SWP_NOREDRAW | SWP_NOOWNERZORDER); | 135 SWP_NOREDRAW | SWP_NOOWNERZORDER); |
135 } | 136 } |
136 | 137 |
137 } // namespace views | 138 } // namespace views |
OLD | NEW |