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

Unified Diff: ash/wm/window_resizer.cc

Issue 10834097: Allow the user to drag a window from one display to another (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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
Index: ash/wm/window_resizer.cc
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc
index 98751066733aa715ee492ce66597f09b3fc70742..42655b9c89eef61712324c1e6373633a7cc6f8ca 100644
--- a/ash/wm/window_resizer.cc
+++ b/ash/wm/window_resizer.cc
@@ -6,7 +6,9 @@
#include "ash/screen_ash.h"
#include "ash/shell.h"
+#include "ash/wm/coordinate_conversion.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -183,11 +185,14 @@ int WindowResizer::AlignToGridRoundDown(int location, int grid_size) {
// static
gfx::Rect WindowResizer::CalculateBoundsForDrag(
const Details& details,
- const gfx::Point& location,
+ const gfx::Point& location_in_screen,
int grid_size) {
if (!details.is_resizable)
return details.initial_bounds;
+ gfx::Point location = location_in_screen;
+ wm::ConvertPointFromScreen(details.window->GetRootWindow(), &location);
+
int delta_x = location.x() - details.initial_location_in_parent.x();
int delta_y = location.y() - details.initial_location_in_parent.y();

Powered by Google App Engine
This is Rietveld 408576698