1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.chrome.browser.compositor.layouts.eventfilter;
6 
7 import android.content.Context;
8 import android.view.MotionEvent;
9 
10 import org.chromium.chrome.browser.layouts.EventFilter;
11 
12 /**
13  * A {@link BlackHoleEventFilter} eats all the events coming its way with no side effects.
14  */
15 public class BlackHoleEventFilter extends EventFilter {
16     /**
17      * Creates a {@link BlackHoleEventFilter}.
18      * @param context A {@link Context} instance.
19      * @param host    A {@link EventFilterHost} instance.
20      */
BlackHoleEventFilter(Context context)21     public BlackHoleEventFilter(Context context) {
22         super(context);
23     }
24 
25     @Override
onInterceptTouchEventInternal(MotionEvent e, boolean isKeyboardShowing)26     public boolean onInterceptTouchEventInternal(MotionEvent e, boolean isKeyboardShowing) {
27         return true;
28     }
29 
30     @Override
onTouchEventInternal(MotionEvent e)31     public boolean onTouchEventInternal(MotionEvent e) {
32         return true;
33     }
34 }