Commit 0c251a15 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Toolbar: Delete unused code in bottom bar

Bottom toolbar does not to support swipe gesture. This CL deletes the
code that handled it in ScrollingBottomViewResourceFrameLayout.

Bug: 1127732
Change-Id: I058005c7f6acceda6872ad99c7cd52ac277fb82b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2428517Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814029}
parent 0508de1e
...@@ -9,11 +9,8 @@ import android.graphics.Canvas; ...@@ -9,11 +9,8 @@ import android.graphics.Canvas;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.Rect; import android.graphics.Rect;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.MotionEvent;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.compositor.layouts.eventfilter.EdgeSwipeHandler;
import org.chromium.chrome.browser.contextualsearch.SwipeRecognizer;
import org.chromium.components.browser_ui.widget.ViewResourceFrameLayout; import org.chromium.components.browser_ui.widget.ViewResourceFrameLayout;
import org.chromium.ui.resources.dynamics.ViewResourceAdapter; import org.chromium.ui.resources.dynamics.ViewResourceAdapter;
...@@ -28,44 +25,11 @@ public class ScrollingBottomViewResourceFrameLayout extends ViewResourceFrameLay ...@@ -28,44 +25,11 @@ public class ScrollingBottomViewResourceFrameLayout extends ViewResourceFrameLay
/** The height of the shadow sitting above the bottom view in px. */ /** The height of the shadow sitting above the bottom view in px. */
private final int mTopShadowHeightPx; private final int mTopShadowHeightPx;
/** A swipe recognizer for handling swipe gestures. */
private SwipeRecognizer mSwipeRecognizer;
public ScrollingBottomViewResourceFrameLayout(Context context, AttributeSet attrs) { public ScrollingBottomViewResourceFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
mTopShadowHeightPx = getResources().getDimensionPixelOffset(R.dimen.toolbar_shadow_height); mTopShadowHeightPx = getResources().getDimensionPixelOffset(R.dimen.toolbar_shadow_height);
} }
/**
* Set the swipe handler for this view and set {@link #isClickable()} to true to allow motion
* events to be intercepted by the view itself.
* @param handler A handler for swipe events on this view.
*/
public void setSwipeDetector(EdgeSwipeHandler handler) {
mSwipeRecognizer = new SwipeRecognizer(getContext());
mSwipeRecognizer.setSwipeHandler(handler);
// TODO(mdjones): This line of code makes it impossible to scroll through the bottom
// toolbar. If the user accidentally swipes up on this view, the scroll no longer goes
// through to the web contents. We should figure out how to make this work while also
// supporting the toolbar swipe behavior.
setClickable(true);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
boolean handledEvent = false;
if (mSwipeRecognizer != null) handledEvent = mSwipeRecognizer.onTouchEvent(event);
return handledEvent || super.onInterceptTouchEvent(event);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean handledEvent = false;
if (mSwipeRecognizer != null) handledEvent = mSwipeRecognizer.onTouchEvent(event);
return handledEvent || super.onTouchEvent(event);
}
@Override @Override
protected ViewResourceAdapter createResourceAdapter() { protected ViewResourceAdapter createResourceAdapter() {
return new ViewResourceAdapter(this) { return new ViewResourceAdapter(this) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment