Index: ui/views/win/hwnd_util_win.cc |
diff --git a/ui/views/win/hwnd_util_win.cc b/ui/views/win/hwnd_util_win.cc |
index 1c642e5240299f7957100128a66766d7a36ff332..094c8ab4ce12acfffe6f26528cd132067b5ac56b 100644 |
--- a/ui/views/win/hwnd_util_win.cc |
+++ b/ui/views/win/hwnd_util_win.cc |
@@ -25,4 +25,15 @@ HWND HWNDForNativeWindow(gfx::NativeWindow window) { |
return window; |
} |
+gfx::Rect GetWindowBoundsForClientBounds(View* view, |
+ const gfx::Rect& client_bounds) { |
+ DCHECK(view); |
+ HWND hwnd = view->GetWidget()->GetNativeWindow(); |
+ RECT rect = client_bounds.ToRECT(); |
+ DWORD style = ::GetWindowLong(hwnd, GWL_STYLE); |
+ DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE); |
+ AdjustWindowRectEx(&rect, style, FALSE, ex_style); |
+ return gfx::Rect(rect); |
} |
+ |
+} // namespace views |