Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: ui/views/win/hwnd_util_aurawin.cc

Issue 13896011: Make javascript dialogs into top-level windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-aura build. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/win/hwnd_util.h ('k') | ui/views/win/hwnd_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_util_aurawin.cc
diff --git a/ui/views/win/hwnd_util_aurawin.cc b/ui/views/win/hwnd_util_aurawin.cc
index fa88c2d0ad07793cf7b94bbc14b96a0e1ce3adfa..a8f68218f3fb542e2ac3dcbd746984acc9286b40 100644
--- a/ui/views/win/hwnd_util_aurawin.cc
+++ b/ui/views/win/hwnd_util_aurawin.cc
@@ -27,4 +27,20 @@ HWND HWNDForNativeWindow(gfx::NativeWindow window) {
window->GetRootWindow()->GetAcceleratedWidget() : NULL;
}
+gfx::Rect GetWindowBoundsForClientBounds(View* view,
+ const gfx::Rect& client_bounds) {
+ DCHECK(view);
+ aura::RootWindow* window =
+ view->GetWidget()->GetNativeWindow()->GetRootWindow();
+ if (window) {
+ HWND hwnd = window->GetAcceleratedWidget();
+ 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);
+ }
+ return client_bounds;
}
+
+} // namespace views
« no previous file with comments | « ui/views/win/hwnd_util.h ('k') | ui/views/win/hwnd_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698