Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
index be3cf7b4c8ff4a0fc1129af23eef7b8393925ed4..67763c3e7adcaa97cd006deb56fcfefd044e7f25 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
@@ -99,7 +99,6 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
// Helpers |
private final LayoutUpdateHost mUpdateHost; |
protected final LayoutRenderHost mRenderHost; |
- private EventFilter mEventFilter; |
/** The tabs currently being rendered as part of this layout. The tabs are |
* drawn using the same ordering as this array. */ |
@@ -120,14 +119,11 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
* @param context The current Android's context. |
* @param updateHost The parent {@link LayoutUpdateHost}. |
* @param renderHost The parent {@link LayoutRenderHost}. |
- * @param eventFilter The {@link EventFilter} this {@link Layout} is listening to. |
*/ |
- public Layout(Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost, |
- EventFilter eventFilter) { |
+ public Layout(Context context, LayoutUpdateHost updateHost, LayoutRenderHost renderHost) { |
mContext = context; |
mUpdateHost = updateHost; |
mRenderHost = renderHost; |
- mEventFilter = eventFilter; |
// Invalid sizes |
mWidthDp = -1; |
@@ -572,69 +568,6 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
} |
/** |
- * Called on touch drag event. |
- * @param time The current time of the app in ms. |
- * @param x The y coordinate of the end of the drag event. |
- * @param y The y coordinate of the end of the drag event. |
- * @param deltaX The number of pixels dragged in the x direction. |
- * @param deltaY The number of pixels dragged in the y direction. |
- */ |
- public void drag(long time, float x, float y, float deltaX, float deltaY) { } |
- |
- /** |
- * Called on touch fling event. This is called before the onUpOrCancel event. |
- * |
- * @param time The current time of the app in ms. |
- * @param x The y coordinate of the start of the fling event. |
- * @param y The y coordinate of the start of the fling event. |
- * @param velocityX The amount of velocity in the x direction. |
- * @param velocityY The amount of velocity in the y direction. |
- */ |
- public void fling(long time, float x, float y, float velocityX, float velocityY) { } |
- |
- /** |
- * 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. |
- */ |
- public void onDown(long time, float x, float y) { } |
- |
- /** |
- * Called on long press touch event. |
- * @param time The current time of the app in ms. |
- * @param x The x coordinate of the position of the press event. |
- * @param y The y coordinate of the position of the press event. |
- */ |
- public void onLongPress(long time, float x, float y) { } |
- |
- /** |
- * Called on click. This is called before the onUpOrCancel event. |
- * @param time The current time of the app in ms. |
- * @param x The x coordinate of the position of the click. |
- * @param y The y coordinate of the position of the click. |
- */ |
- public void click(long time, float x, float y) { } |
- |
- /** |
- * Called on up or cancel touch events. This is called after the click and fling event if any. |
- * @param time The current time of the app in ms. |
- */ |
- public void onUpOrCancel(long time) { } |
- |
- /** |
- * Called when at least 2 touch events are detected. |
- * @param time The current time of the app in ms. |
- * @param x0 The x coordinate of the first touch event. |
- * @param y0 The y coordinate of the first touch event. |
- * @param x1 The x coordinate of the second touch event. |
- * @param y1 The y coordinate of the second touch event. |
- * @param firstEvent The pinch is the first of a sequence of pinch events. |
- */ |
- public void onPinch(long time, float x0, float y0, float x1, float y1, boolean firstEvent) { } |
- |
- /** |
* Called by the LayoutManager when an animation should be killed. |
*/ |
public void unstallImmediately() { } |
@@ -1038,15 +971,6 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
} |
/** |
- * Setting this will only take effect the next time this layout is shown. If it is currently |
- * showing the original filter will still be used. |
- * @param filter |
- */ |
- public void setEventFilter(EventFilter filter) { |
- mEventFilter = filter; |
- } |
- |
- /** |
* @param e The {@link MotionEvent} to consider. |
* @param offsets The current touch offsets that should be applied to the |
* {@link EventFilter}s. |
@@ -1064,9 +988,14 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
if (eventFilter.onInterceptTouchEvent(e, isKeyboardShowing)) return eventFilter; |
} |
- if (mEventFilter != null) { |
- if (offsets != null) mEventFilter.setCurrentMotionEventOffsets(offsets.x, offsets.y); |
- if (mEventFilter.onInterceptTouchEvent(e, isKeyboardShowing)) return mEventFilter; |
+ EventFilter layoutEventFilter = getEventFilter(); |
+ if (layoutEventFilter != null) { |
+ if (offsets != null) { |
+ layoutEventFilter.setCurrentMotionEventOffsets(offsets.x, offsets.y); |
+ } |
+ if (layoutEventFilter.onInterceptTouchEvent(e, isKeyboardShowing)) { |
+ return layoutEventFilter; |
+ } |
} |
return null; |
} |
@@ -1127,11 +1056,9 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
} |
/** |
- * @return Whether the tabstrip's event filter is enabled. |
+ * @return The EventFilter to use for processing events for this Layout. |
*/ |
- public boolean isTabStripEventFilterEnabled() { |
- return true; |
- } |
+ protected abstract EventFilter getEventFilter(); |
/** |
* Get an instance of {@link SceneLayer}. Any class inheriting {@link Layout} |