summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 19:15:00 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 19:15:00 +0000
commited3729b99a05d6cf23c19f83e72d7479848a8c1a (patch)
tree2ad2ca3e42d83bff967c812f9ab3bcd68beff8fb /chrome/browser
parentc03ef7650909d5d6a4ea883da682e2dacd336381 (diff)
downloadchromium_src-ed3729b99a05d6cf23c19f83e72d7479848a8c1a.zip
chromium_src-ed3729b99a05d6cf23c19f83e72d7479848a8c1a.tar.gz
chromium_src-ed3729b99a05d6cf23c19f83e72d7479848a8c1a.tar.bz2
Some bandaids for tab dragging UI tests:
- automation provider was moving mouse pointer to position in client coords, not screen coords as required. - TabStrip was allowing drags to occur in invalid conditions. This doesn't completely fix the underlying broken-ness of the SimulateDrag function, however I've not yet been able to get a version of it using SendInput working. http://crbug.com/4067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-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()));