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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 1747803003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extract DragsWindowUsingCocoaMoveLoop test, cleanup code. Created 4 years, 9 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: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index 5c5160367fccd04fa56076e1a5c9f61f7242fba8..7e426218c8a70f4ec1e0ec7a23e7534059af57c7 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -382,7 +382,7 @@ void TabDragController::Drag(const gfx::Point& point_in_screen) {
&drag_bounds);
widget->SetVisibilityChangedAnimationsEnabled(true);
}
- RunMoveLoop(GetWindowOffset(point_in_screen));
+ RunMoveLoop(GetWindowOffset(start_point_in_screen_));
tapted 2016/03/10 11:51:18 I think this should land first and separately with
themblsha 2016/03/10 17:18:58 Without this fix the DetachToBrowserTabDragControl
tapted 2016/03/11 09:38:28 The problem currently is that it's hard for a revi
themblsha 2016/04/05 17:20:42 Added this comment: // Always use the start
return;
}
}
@@ -524,8 +524,9 @@ bool TabDragController::CanStartDrag(const gfx::Point& point_in_screen) const {
static const int kMinimumDragDistance = 10;
int x_offset = abs(point_in_screen.x() - start_point_in_screen_.x());
int y_offset = abs(point_in_screen.y() - start_point_in_screen_.y());
- return sqrt(pow(static_cast<float>(x_offset), 2) +
+ bool result = sqrt(pow(static_cast<float>(x_offset), 2) +
tapted 2016/03/10 11:51:18 nit: this change not needed
themblsha 2016/03/10 17:18:58 Done.
pow(static_cast<float>(y_offset), 2)) > kMinimumDragDistance;
+ return result;
}
void TabDragController::ContinueDragging(const gfx::Point& point_in_screen) {
@@ -608,6 +609,7 @@ TabDragController::DragBrowserToNewTabStrip(
// going to trigger capture lost, which cancels drag.
attached_tabstrip_->ReleaseDragController();
target_tabstrip->OwnDragController(this);
+
tapted 2016/03/10 11:51:18 nit: remove added line
themblsha 2016/03/10 17:18:58 Done.
// Disable animations so that we don't see a close animation on aero.
browser_widget->SetVisibilityChangedAnimationsEnabled(false);
if (can_release_capture_)

Powered by Google App Engine
This is Rietveld 408576698