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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 312293002: Paste popup is positioning properly during content scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments and line breaks. Created 6 years, 4 months 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 2012 The Chromium Authors. All rights reserved. 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 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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.app.SearchManager; 9 import android.app.SearchManager;
10 import android.content.ClipboardManager; 10 import android.content.ClipboardManager;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 // Only valid when focused on a text / password field. 287 // Only valid when focused on a text / password field.
288 private ImeAdapter mImeAdapter; 288 private ImeAdapter mImeAdapter;
289 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory; 289 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory;
290 private AdapterInputConnection mInputConnection; 290 private AdapterInputConnection mInputConnection;
291 private InputMethodManagerWrapper mInputMethodManagerWrapper; 291 private InputMethodManagerWrapper mInputMethodManagerWrapper;
292 292
293 // Lazily created paste popup menu, triggered either via long press in an 293 // Lazily created paste popup menu, triggered either via long press in an
294 // editable region or from tapping the insertion handle. 294 // editable region or from tapping the insertion handle.
295 private PastePopupMenu mPastePopupMenu; 295 private PastePopupMenu mPastePopupMenu;
296 private boolean mWasPastePopupShowingOnInsertionDragStart;
296 297
297 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; 298 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate;
298 299
299 private PositionObserver mPositionObserver; 300 private PositionObserver mPositionObserver;
300 301
301 // Size of the viewport in physical pixels as set from onSizeChanged. 302 // Size of the viewport in physical pixels as set from onSizeChanged.
302 private int mViewportWidthPix; 303 private int mViewportWidthPix;
303 private int mViewportHeightPix; 304 private int mViewportHeightPix;
304 private int mPhysicalBackingWidthPix; 305 private int mPhysicalBackingWidthPix;
305 private int mPhysicalBackingHeightPix; 306 private int mPhysicalBackingHeightPix;
(...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2202 case SelectionEventType.SELECTION_CLEARED: 2203 case SelectionEventType.SELECTION_CLEARED:
2203 mHasSelection = false; 2204 mHasSelection = false;
2204 mUnselectAllOnActionModeDismiss = false; 2205 mUnselectAllOnActionModeDismiss = false;
2205 hideSelectActionBar(); 2206 hideSelectActionBar();
2206 break; 2207 break;
2207 2208
2208 case SelectionEventType.INSERTION_SHOWN: 2209 case SelectionEventType.INSERTION_SHOWN:
2209 mHasInsertion = true; 2210 mHasInsertion = true;
2210 break; 2211 break;
2211 2212
2212 case SelectionEventType.INSERTION_MOVED: 2213 case SelectionEventType.INSERTION_DRAG_STARTED:
2213 // TODO(jdduke): Handle case where movement triggered by focus. 2214 mWasPastePopupShowingOnInsertionDragStart =
2215 mPastePopupMenu != null && mPastePopupMenu.isShowing();
2214 hidePastePopup(); 2216 hidePastePopup();
2215 break; 2217 break;
2216 2218
2219 case SelectionEventType.INSERTION_MOVED:
2220 if (mPastePopupMenu == null) break;
2221 if (!isScrollInProgress() && mPastePopupMenu.isShowing()) {
2222 showPastePopup((int) posXDip, (int) posYDip);
2223 } else {
2224 hidePastePopup();
2225 }
2226 break;
2227
2217 case SelectionEventType.INSERTION_TAPPED: 2228 case SelectionEventType.INSERTION_TAPPED:
2218 if (getPastePopup().isShowing()) 2229 if (mWasPastePopupShowingOnInsertionDragStart)
2219 mPastePopupMenu.hide(); 2230 hidePastePopup();
2220 else 2231 else
2221 showPastePopup((int) posXDip, (int) posYDip); 2232 showPastePopup((int) posXDip, (int) posYDip);
2222 break; 2233 break;
2223 2234
2224 case SelectionEventType.INSERTION_CLEARED: 2235 case SelectionEventType.INSERTION_CLEARED:
2225 mHasInsertion = false; 2236 mHasInsertion = false;
2226 hidePastePopup(); 2237 hidePastePopup();
2227 break; 2238 break;
2228 2239
2229 default: 2240 default:
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
3324 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); 3335 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque);
3325 private native void nativeSetupTransitionView(long nativeContentViewCoreImpl , String markup); 3336 private native void nativeSetupTransitionView(long nativeContentViewCoreImpl , String markup);
3326 private native void nativeBeginExitTransition(long nativeContentViewCoreImpl , 3337 private native void nativeBeginExitTransition(long nativeContentViewCoreImpl ,
3327 String cssSelector); 3338 String cssSelector);
3328 3339
3329 private native void nativeResumeResponseDeferredAtStart( 3340 private native void nativeResumeResponseDeferredAtStart(
3330 long nativeContentViewCoreImpl); 3341 long nativeContentViewCoreImpl);
3331 private native void nativeSetHasPendingNavigationTransitionForTesting( 3342 private native void nativeSetHasPendingNavigationTransitionForTesting(
3332 long nativeContentViewCoreImpl); 3343 long nativeContentViewCoreImpl);
3333 } 3344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698