OLD | NEW |
---|---|
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 | 274 |
275 // Only valid when focused on a text / password field. | 275 // Only valid when focused on a text / password field. |
276 private ImeAdapter mImeAdapter; | 276 private ImeAdapter mImeAdapter; |
277 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory; | 277 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory; |
278 private AdapterInputConnection mInputConnection; | 278 private AdapterInputConnection mInputConnection; |
279 private InputMethodManagerWrapper mInputMethodManagerWrapper; | 279 private InputMethodManagerWrapper mInputMethodManagerWrapper; |
280 | 280 |
281 // Lazily created paste popup menu, triggered either via long press in an | 281 // Lazily created paste popup menu, triggered either via long press in an |
282 // editable region or from tapping the insertion handle. | 282 // editable region or from tapping the insertion handle. |
283 private PastePopupMenu mPastePopupMenu; | 283 private PastePopupMenu mPastePopupMenu; |
284 private boolean mWasPastePopupShowing = false; | |
jdduke (slow)
2014/07/30 17:39:09
Maybe rename this to |mWasPastePopupShowingOnInser
AKVT
2014/08/01 14:42:08
Done.
| |
284 | 285 |
285 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; | 286 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; |
286 | 287 |
287 private PositionObserver mPositionObserver; | 288 private PositionObserver mPositionObserver; |
288 | 289 |
289 // Size of the viewport in physical pixels as set from onSizeChanged. | 290 // Size of the viewport in physical pixels as set from onSizeChanged. |
290 private int mViewportWidthPix; | 291 private int mViewportWidthPix; |
291 private int mViewportHeightPix; | 292 private int mViewportHeightPix; |
292 private int mPhysicalBackingWidthPix; | 293 private int mPhysicalBackingWidthPix; |
293 private int mPhysicalBackingHeightPix; | 294 private int mPhysicalBackingHeightPix; |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2175 case SelectionEventType.SELECTION_CLEARED: | 2176 case SelectionEventType.SELECTION_CLEARED: |
2176 mHasSelection = false; | 2177 mHasSelection = false; |
2177 mUnselectAllOnActionModeDismiss = false; | 2178 mUnselectAllOnActionModeDismiss = false; |
2178 hideSelectActionBar(); | 2179 hideSelectActionBar(); |
2179 break; | 2180 break; |
2180 | 2181 |
2181 case SelectionEventType.INSERTION_SHOWN: | 2182 case SelectionEventType.INSERTION_SHOWN: |
2182 mHasInsertion = true; | 2183 mHasInsertion = true; |
2183 break; | 2184 break; |
2184 | 2185 |
2185 case SelectionEventType.INSERTION_MOVED: | 2186 case SelectionEventType.INSERTION_DRAG_BEGUN: |
2186 // TODO(jdduke): Handle case where movement triggered by focus. | 2187 mWasPastePopupShowing = getPastePopup().isShowing(); |
2187 hidePastePopup(); | 2188 hidePastePopup(); |
2188 break; | 2189 break; |
2189 | 2190 |
2191 case SelectionEventType.INSERTION_MOVED: | |
2192 if (getPastePopup().isShowing() && !isScrollInProgress()) { | |
2193 showPastePopup((int) posXDip, (int) posYDip); | |
2194 } else { | |
2195 hidePastePopup(); | |
2196 } | |
2197 break; | |
2198 | |
2190 case SelectionEventType.INSERTION_TAPPED: | 2199 case SelectionEventType.INSERTION_TAPPED: |
2191 if (getPastePopup().isShowing()) | 2200 if (mWasPastePopupShowing) |
2192 mPastePopupMenu.hide(); | 2201 mPastePopupMenu.hide(); |
2193 else | 2202 else |
2194 showPastePopup((int) posXDip, (int) posYDip); | 2203 showPastePopup((int) posXDip, (int) posYDip); |
2195 break; | 2204 break; |
2196 | 2205 |
2197 case SelectionEventType.INSERTION_CLEARED: | 2206 case SelectionEventType.INSERTION_CLEARED: |
2198 mHasInsertion = false; | 2207 mHasInsertion = false; |
2208 mWasPastePopupShowing = false; | |
2199 hidePastePopup(); | 2209 hidePastePopup(); |
2200 break; | 2210 break; |
2201 | 2211 |
2202 default: | 2212 default: |
2203 assert false : "Invalid selection event type."; | 2213 assert false : "Invalid selection event type."; |
2204 } | 2214 } |
2205 } | 2215 } |
2206 | 2216 |
2207 public boolean getUseDesktopUserAgent() { | 2217 public boolean getUseDesktopUserAgent() { |
2208 if (mNativeContentViewCore != 0) { | 2218 if (mNativeContentViewCore != 0) { |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3283 | 3293 |
3284 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 3294 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
3285 int x, int y, int w, int h); | 3295 int x, int y, int w, int h); |
3286 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 3296 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
3287 | 3297 |
3288 private native void nativeResumeResponseDeferredAtStart( | 3298 private native void nativeResumeResponseDeferredAtStart( |
3289 long nativeContentViewCoreImpl); | 3299 long nativeContentViewCoreImpl); |
3290 private native void nativeSetHasPendingNavigationTransitionForTesting( | 3300 private native void nativeSetHasPendingNavigationTransitionForTesting( |
3291 long nativeContentViewCoreImpl); | 3301 long nativeContentViewCoreImpl); |
3292 } | 3302 } |
OLD | NEW |