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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/CascadeEventFilter.java

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.compositor.layouts.eventfilter; 5 package org.chromium.chrome.browser.compositor.layouts.eventfilter;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.view.MotionEvent; 8 import android.view.MotionEvent;
9 9
10 import java.util.Arrays; 10 import java.util.Arrays;
11 11
12 /** 12 /**
13 * A {@link CascadeEventFilter} delegates all the events coming its way to anoth er filter. 13 * A {@link CascadeEventFilter} delegates all the events coming its way to anoth er filter.
14 */ 14 */
15 public class CascadeEventFilter extends EventFilter { 15 public class CascadeEventFilter extends EventFilter {
16 private EventFilter[] mDelegates; 16 private EventFilter[] mDelegates;
17 private EventFilter mActiveDelegate = null; 17 private EventFilter mActiveDelegate;
18 18
19 /** 19 /**
20 * Creates a {@link CascadeEventFilter}. 20 * Creates a {@link CascadeEventFilter}.
21 * 21 *
22 * The delegates will be queried in the order specified in this list (0 -> c ount). Once a 22 * The delegates will be queried in the order specified in this list (0 -> c ount). Once a
23 * delegate takes ownership of the event by returning {@code true} from 23 * delegate takes ownership of the event by returning {@code true} from
24 * {@link EventFilter#onInterceptTouchEventInternal(MotionEvent, boolean)} i t will get all 24 * {@link EventFilter#onInterceptTouchEventInternal(MotionEvent, boolean)} i t will get all
25 * subsequent events for the same gesture to 25 * subsequent events for the same gesture to
26 * {@link EventFilter#onTouchEventInternal(MotionEvent)}. 26 * {@link EventFilter#onTouchEventInternal(MotionEvent)}.
27 * 27 *
(...skipping 27 matching lines...) Expand all
55 public boolean onTouchEventInternal(MotionEvent e) { 55 public boolean onTouchEventInternal(MotionEvent e) {
56 if (mActiveDelegate != null) { 56 if (mActiveDelegate != null) {
57 if (mActiveDelegate.autoOffsetEvents()) { 57 if (mActiveDelegate.autoOffsetEvents()) {
58 e.offsetLocation(mCurrentTouchOffsetX, mCurrentTouchOffsetY); 58 e.offsetLocation(mCurrentTouchOffsetX, mCurrentTouchOffsetY);
59 } 59 }
60 return mActiveDelegate.onTouchEventInternal(e); 60 return mActiveDelegate.onTouchEventInternal(e);
61 } 61 }
62 return false; 62 return false;
63 } 63 }
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698