Chromium Code Reviews| Index: android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java b/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java |
| similarity index 94% |
| rename from content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| rename to android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java |
| index dce0644ca968d5776a59fb724a9aae67b72a5d2a..5ef6098c56e44bd31a0d0406b3823e99f01aa283 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java |
| +++ b/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java |
| @@ -1,8 +1,8 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
boliu
2016/08/24 23:35:30
curious, did presubmit complain about updating the
Jinsuk Kim
2016/08/25 07:32:21
No presubmit doesn't. Let me know if the year does
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -package org.chromium.content.browser.input; |
| +package org.chromium.android_webview; |
| import android.annotation.SuppressLint; |
| import android.content.Context; |
| @@ -19,10 +19,10 @@ import android.widget.PopupWindow; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.base.annotations.JNINamespace; |
| -import org.chromium.content.browser.ContainerViewObserver; |
| import org.chromium.content.browser.ContentViewCore; |
| import org.chromium.content.browser.PositionObserver; |
| import org.chromium.content.browser.ViewPositionObserver; |
| +import org.chromium.content.browser.input.HandleViewResources; |
| import org.chromium.content_public.browser.GestureStateListener; |
| import org.chromium.ui.touch_selection.TouchHandleOrientation; |
| @@ -36,11 +36,10 @@ import java.lang.reflect.Method; |
| * hierarchy. |
| * |
| */ |
| -@JNINamespace("content") |
| +@JNINamespace("android_webview") |
| public class PopupTouchHandleDrawable extends View { |
| private final PopupWindow mContainer; |
| private final PositionObserver.Listener mParentPositionListener; |
| - private final ContainerViewObserver mParentViewObserver; |
| private ContentViewCore mContentViewCore; |
| private PositionObserver mParentPositionObserver; |
| private Drawable mDrawable; |
| @@ -122,18 +121,6 @@ public class PopupTouchHandleDrawable extends View { |
| updateParentPosition(x, y); |
| } |
| }; |
| - mParentViewObserver = new ContainerViewObserver() { |
| - @Override |
| - public void onContainerViewChanged(ViewGroup newContainerView) { |
| - // If the parent View ever changes, the parent position observer |
| - // must be updated accordingly. |
| - mParentPositionObserver.clearListener(); |
| - mParentPositionObserver = new ViewPositionObserver(newContainerView); |
| - if (mContainer.isShowing()) { |
| - mParentPositionObserver.addListener(mParentPositionListener); |
| - } |
| - } |
| - }; |
| mGestureStateListener = new GestureStateListener() { |
| @Override |
| public void onScrollStarted(int scrollOffsetX, int scrollOffsetY) { |
| @@ -165,7 +152,6 @@ public class PopupTouchHandleDrawable extends View { |
| } |
| }; |
| mContentViewCore.addGestureStateListener(mGestureStateListener); |
| - mContentViewCore.addContainerViewObserver(mParentViewObserver); |
| } |
| private static void setWindowLayoutType(PopupWindow window, int layoutType) { |
| @@ -436,7 +422,6 @@ public class PopupTouchHandleDrawable extends View { |
| if (mContentViewCore == null) return; |
| hide(); |
| mContentViewCore.removeGestureStateListener(mGestureStateListener); |
| - mContentViewCore.removeContainerViewObserver(mParentViewObserver); |
| mContentViewCore = null; |
| } |
| @@ -515,4 +500,14 @@ public class PopupTouchHandleDrawable extends View { |
| if (mDrawable == null) return 0; |
| return mDrawable.getIntrinsicHeight(); |
| } |
| + |
| + public void onContainerViewChanged(ViewGroup newContainerView) { |
| + // If the parent View ever changes, the parent position observer |
| + // must be updated accordingly. |
| + mParentPositionObserver.clearListener(); |
| + mParentPositionObserver = new ViewPositionObserver(newContainerView); |
| + if (mContainer.isShowing()) { |
| + mParentPositionObserver.addListener(mParentPositionListener); |
| + } |
| + } |
| } |