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/widget/widget_win.h" | 5 #include "views/widget/widget_win.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/win_util.h" | 8 #include "app/win_util.h" |
9 #include "base/gfx/native_theme.h" | 9 #include "base/gfx/native_theme.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 GetClientRect(&crect); | 249 GetClientRect(&crect); |
250 POINT p = {0, 0}; | 250 POINT p = {0, 0}; |
251 ::ClientToScreen(hwnd_, &p); | 251 ::ClientToScreen(hwnd_, &p); |
252 out->SetRect(crect.left + p.x, crect.top + p.y, | 252 out->SetRect(crect.left + p.x, crect.top + p.y, |
253 crect.Width(), crect.Height()); | 253 crect.Width(), crect.Height()); |
254 } | 254 } |
255 | 255 |
256 void WidgetWin::SetBounds(const gfx::Rect& bounds) { | 256 void WidgetWin::SetBounds(const gfx::Rect& bounds) { |
257 SetWindowPos(NULL, bounds.x(), bounds.y(), bounds.width(), bounds.height(), | 257 SetWindowPos(NULL, bounds.x(), bounds.y(), bounds.width(), bounds.height(), |
258 SWP_NOACTIVATE); | 258 SWP_NOACTIVATE | SWP_NOZORDER); |
259 } | 259 } |
260 | 260 |
261 void WidgetWin::Close() { | 261 void WidgetWin::Close() { |
262 if (!IsWindow()) | 262 if (!IsWindow()) |
263 return; // No need to do anything. | 263 return; // No need to do anything. |
264 | 264 |
265 // Let's hide ourselves right away. | 265 // Let's hide ourselves right away. |
266 Hide(); | 266 Hide(); |
267 if (close_widget_factory_.empty()) { | 267 if (close_widget_factory_.empty()) { |
268 // And we delay the close so that if we are called from an ATL callback, | 268 // And we delay the close so that if we are called from an ATL callback, |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 if (!widget->ProcessWindowMessage(window, message, w_param, l_param, result)) | 1032 if (!widget->ProcessWindowMessage(window, message, w_param, l_param, result)) |
1033 result = DefWindowProc(window, message, w_param, l_param); | 1033 result = DefWindowProc(window, message, w_param, l_param); |
1034 if (message == WM_NCDESTROY) { | 1034 if (message == WM_NCDESTROY) { |
1035 widget->hwnd_ = NULL; | 1035 widget->hwnd_ = NULL; |
1036 widget->OnFinalMessage(window); | 1036 widget->OnFinalMessage(window); |
1037 } | 1037 } |
1038 return result; | 1038 return result; |
1039 } | 1039 } |
1040 | 1040 |
1041 } // namespace views | 1041 } // namespace views |
OLD | NEW |