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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java

Issue 1261443002: [Android] Removes delay when a tab is dragged with a mouse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Android] Removes delay when a tab is dragged with a mouse (document new parameters) Created 5 years, 5 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/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
index 6b9d640818f3b5d00cdf8985f58e3bfecefbf1ee..e1668ea469bc705144618cce942e77e36defcada 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
@@ -594,11 +594,12 @@ public class StripLayoutHelper {
/**
* Called on onDown event.
- * @param time The time stamp in millisecond of the event.
- * @param x The x position of the event.
- * @param y The y position of the event.
+ * @param time The time stamp in millisecond of the event.
+ * @param x The x position of the event.
+ * @param y The y position of the event.
+ * @param fromMouse Whether the event originates from a mouse.
*/
- public void onDown(long time, float x, float y) {
+ public void onDown(long time, float x, float y, boolean fromMouse) {
resetResizeTimeout(false);
if (mNewTabButton.onDown(x, y)) {
@@ -616,7 +617,9 @@ public class StripLayoutHelper {
mInteractingTab = index != TabModel.INVALID_TAB_INDEX && index < mStripTabs.length
? mStripTabs[index]
: null;
- if (clickedTab != null && clickedTab.checkCloseHitTest(x, y)) {
+ boolean clickedClose = clickedTab != null
+ && clickedTab.checkCloseHitTest(x, y);
+ if (clickedClose) {
clickedTab.setClosePressed(true);
mLastPressedCloseButton = clickedTab.getCloseButton();
mRenderHost.requestRender();
@@ -626,6 +629,10 @@ public class StripLayoutHelper {
mScroller.forceFinished(true);
mInteractingTab = null;
}
+
+ if (fromMouse && !clickedClose) {
+ startReorderMode(time, x, x);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698