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

Unified Diff: ui/views/window/native_frame_view.cc

Issue 13896011: Make javascript dialogs into top-level windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct window bounds calculations for native dialogs on desktop windows aura. 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/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/native_frame_view.cc
diff --git a/ui/views/window/native_frame_view.cc b/ui/views/window/native_frame_view.cc
index 0a28110e8affcc23b80f7dd8cb06444fc1e1790c..f133878fdaa90263d4b836e41323ced07535377c 100644
--- a/ui/views/window/native_frame_view.cc
+++ b/ui/views/window/native_frame_view.cc
@@ -7,6 +7,10 @@
#include "ui/views/widget/native_widget.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_AURA) && defined(OS_WIN)
+#include "ui/aura/root_window.h"
+#endif
+
namespace views {
////////////////////////////////////////////////////////////////////////////////
@@ -29,12 +33,26 @@ gfx::Rect NativeFrameView::GetBoundsForClientView() const {
gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
+#if defined(USE_AURA)
+ aura::RootWindow* window = GetWidget()->GetNativeWindow()->GetRootWindow();
+ if (window) {
+ gfx::AcceleratedWidget hwnd = window->GetAcceleratedWidget();
Ben Goodger (Google) 2013/04/29 16:21:55 do we have a util file in views/ui that has a bunc
robertshield 2013/04/29 21:49:59 Moved most of this into hwnd_util_[win|aurawin].cc
+ 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);
+ } else {
+ return client_bounds;
+ }
+#else
RECT rect = client_bounds.ToRECT();
DWORD style = ::GetWindowLong(GetWidget()->GetNativeView(), GWL_STYLE);
DWORD ex_style = ::GetWindowLong(GetWidget()->GetNativeView(), GWL_EXSTYLE);
AdjustWindowRectEx(&rect, style, FALSE, ex_style);
return gfx::Rect(rect);
+#endif // defined(USE_AURA)
#else
// TODO(sad):
return client_bounds;
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698