summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/automation_provider.cc9
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc2
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 820d446..665417f 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1324,15 +1324,20 @@ void AutomationProvider::WindowSimulateDrag(const IPC::Message& message,
Browser* browser = browser_tracker_->GetResource(handle);
DCHECK(browser);
HWND top_level_hwnd = browser->GetTopLevelHWND();
- SetCursorPos(drag_path[0].x, drag_path[0].y);
+ POINT temp = drag_path[0];
+ MapWindowPoints(top_level_hwnd, HWND_DESKTOP, &temp, 1);
+ SetCursorPos(temp.x, temp.y);
SendMessage(top_level_hwnd, down_message, wparam_flags,
MAKELPARAM(drag_path[0].x, drag_path[0].y));
for (int i = 1; i < static_cast<int>(drag_path.size()); ++i) {
- SetCursorPos(drag_path[i].x, drag_path[i].y);
+ temp = drag_path[i];
+ MapWindowPoints(top_level_hwnd, HWND_DESKTOP, &temp, 1);
+ SetCursorPos(temp.x, temp.y);
SendMessage(top_level_hwnd, WM_MOUSEMOVE, wparam_flags,
MAKELPARAM(drag_path[i].x, drag_path[i].y));
}
POINT end = drag_path[drag_path.size() - 1];
+ MapWindowPoints(top_level_hwnd, HWND_DESKTOP, &end, 1);
SetCursorPos(end.x, end.y);
if (press_escape_en_route) {
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 55c4a908..5269f2c 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -1011,7 +1011,7 @@ void TabStrip::MaybeStartDrag(Tab* tab, const views::MouseEvent& event) {
// mouse is down... during an animation tabs are being resized automatically,
// so the View system can misinterpret this easily if the mouse is down that
// the user is dragging.
- if (IsAnimating() || tab->closing())
+ if (IsAnimating() || tab->closing() || !HasAvailableDragActions())
return;
drag_controller_.reset(new DraggedTabController(tab, this));
drag_controller_->CaptureDragInfo(gfx::Point(event.x(), event.y()));