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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 231723005: Fix logic surrounding window / root window coordinates in Ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ce3e7c0cf2e1f0ef3d5daa5160a94ddc00085540..3c36a9bfe9fa0878a3be3d5ac0ddd9d57dc400a9 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1791,32 +1791,13 @@ void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) {
}
gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() {
-#if defined(OS_WIN)
- // aura::Window::GetBoundsInScreen doesn't take non-client area into
- // account.
- RECT window_rect = {0};
-
- aura::Window* top_level = window_->GetToplevelWindow();
- aura::WindowTreeHost* host = top_level->GetHost();
- if (!host)
- return top_level->GetBoundsInScreen();
- HWND hwnd = host->GetAcceleratedWidget();
- ::GetWindowRect(hwnd, &window_rect);
- gfx::Rect rect(window_rect);
-
- // Maximized windows are outdented from the work area by the frame thickness
- // even though this "frame" is not painted. This confuses code (and people)
- // that think of a maximized window as corresponding exactly to the work area.
- // Correct for this by subtracting the frame thickness back off.
- if (::IsZoomed(hwnd)) {
- rect.Inset(GetSystemMetrics(SM_CXSIZEFRAME),
- GetSystemMetrics(SM_CYSIZEFRAME));
- }
+ gfx::Rect rect = window_->GetToplevelWindow()->GetBoundsInScreen();
- return gfx::win::ScreenToDIPRect(rect);
-#else
- return window_->GetToplevelWindow()->GetBoundsInScreen();
+#if defined(OS_WIN)
+ rect = gfx::win::ScreenToDIPRect(rect);
#endif
+
+ return rect;
}
void RenderWidgetHostViewAura::GestureEventAck(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698