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

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

Issue 871813003: Fix popup window repositioning in Desktop Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix state clean up in the test Created 5 years, 11 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 | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 88c60906b7268d02bffd85fdb683ef05c9bca77a..c8a59ba57b463d6411ceec1c43d95c87d4b799b1 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -145,8 +145,11 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver {
void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override {
+ // The position of the window may have changed. Hence we use SetBounds in
+ // place of SetSize. We need to pass the bounds in screen coordinates to
+ // the Widget::SetBounds function.
if (top_level_widget_ && window == child_window_)
- top_level_widget_->SetSize(new_bounds.size());
+ top_level_widget_->SetBounds(window->GetBoundsInScreen());
}
private:
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698