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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_position_client.cc

Issue 2583873002: Correctly update the popup window position (Closed)
Patch Set: use content_window_ Created 4 years 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 | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_screen_position_client.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
index 6096b4e10797dd8fa0a299c5db14e4b3ca5040be..b6ed6e571a2fa571df179409425c303143ee9801 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
@@ -38,10 +38,17 @@ void DesktopScreenPositionClient::SetBounds(aura::Window* window,
// TODO(jam): Use the 3rd parameter, |display|.
aura::Window* root = window->GetRootWindow();
- // This method assumes that |window| does not have an associated
- // DesktopNativeWidgetAura.
internal::NativeWidgetPrivate* desktop_native_widget =
DesktopNativeWidgetAura::ForWindow(root);
+ // The screen bounds request to the content_window_ should be interpreted as
+ // a widget bounds change.
+ if (desktop_native_widget &&
+ desktop_native_widget->GetNativeView() == window) {
+ desktop_native_widget->GetWidget()->SetBounds(bounds);
+ return;
sadrul 2016/12/19 18:08:56 It looks like DesktopNativeWidgetAura::OnBoundsCha
oshima 2016/12/20 23:55:32 Did you mean DesktopNativeWidgetTopLevelHandler::O
+ }
+ // The following logic assumes that |window| does not have an associated
+ // DesktopNativeWidgetAura.
Bret 2016/12/21 00:04:25 nit: since you're explicitly handling the dchecked
DCHECK(!desktop_native_widget ||
desktop_native_widget->GetNativeView() != window);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698