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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 | 266 |
267 // Only valid when focused on a text / password field. | 267 // Only valid when focused on a text / password field. |
268 private ImeAdapter mImeAdapter; | 268 private ImeAdapter mImeAdapter; |
269 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory; | 269 private ImeAdapter.AdapterInputConnectionFactory mAdapterInputConnectionFact ory; |
270 private AdapterInputConnection mInputConnection; | 270 private AdapterInputConnection mInputConnection; |
271 private InputMethodManagerWrapper mInputMethodManagerWrapper; | 271 private InputMethodManagerWrapper mInputMethodManagerWrapper; |
272 | 272 |
273 // Lazily created paste popup menu, triggered either via long press in an | 273 // Lazily created paste popup menu, triggered either via long press in an |
274 // editable region or from tapping the insertion handle. | 274 // editable region or from tapping the insertion handle. |
275 private PastePopupMenu mPastePopupMenu; | 275 private PastePopupMenu mPastePopupMenu; |
276 private boolean mWasPastePopupShowing = false; | |
jdduke (slow)
2014/07/30 17:39:09
Nit: booleans always default to false in Java, no
AKVT
2014/08/01 14:42:07
Done.
| |
276 | 277 |
277 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; | 278 private PopupTouchHandleDrawableDelegate mTouchHandleDelegate; |
278 | 279 |
279 private PositionObserver mPositionObserver; | 280 private PositionObserver mPositionObserver; |
280 | 281 |
281 // Size of the viewport in physical pixels as set from onSizeChanged. | 282 // Size of the viewport in physical pixels as set from onSizeChanged. |
282 private int mViewportWidthPix; | 283 private int mViewportWidthPix; |
283 private int mViewportHeightPix; | 284 private int mViewportHeightPix; |
284 private int mPhysicalBackingWidthPix; | 285 private int mPhysicalBackingWidthPix; |
285 private int mPhysicalBackingHeightPix; | 286 private int mPhysicalBackingHeightPix; |
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2143 case SelectionEventType.SELECTION_CLEARED: | 2144 case SelectionEventType.SELECTION_CLEARED: |
2144 mHasSelection = false; | 2145 mHasSelection = false; |
2145 mUnselectAllOnActionModeDismiss = false; | 2146 mUnselectAllOnActionModeDismiss = false; |
2146 hideSelectActionBar(); | 2147 hideSelectActionBar(); |
2147 break; | 2148 break; |
2148 | 2149 |
2149 case SelectionEventType.INSERTION_SHOWN: | 2150 case SelectionEventType.INSERTION_SHOWN: |
2150 mHasInsertion = true; | 2151 mHasInsertion = true; |
2151 break; | 2152 break; |
2152 | 2153 |
2153 case SelectionEventType.INSERTION_MOVED: | 2154 case SelectionEventType.INSERTION_DRAG_BEGUN: |
2154 // TODO(jdduke): Handle case where movement triggered by focus. | 2155 mWasPastePopupShowing = getPastePopup().isShowing(); |
jdduke (slow)
2014/07/23 16:54:58
Hmm, I'd like to first land a change that suppress
AKVT
2014/07/23 17:19:01
Thanks for the clarification. I will hold this cha
| |
2155 hidePastePopup(); | 2156 hidePastePopup(); |
2156 break; | 2157 break; |
2157 | 2158 |
2159 case SelectionEventType.INSERTION_MOVED: | |
2160 boolean isPastePopupShowing = getPastePopup().isShowing(); | |
2161 hidePastePopup(); | |
jdduke (slow)
2014/07/28 15:51:07
Can we avoid hiding then immediately showing? I th
AKVT
2014/07/28 16:56:58
We have to reposition the popup even when it was s
jdduke (slow)
2014/07/28 17:26:28
That sounds like a bug to me. What if you delete t
AKVT
2014/07/30 12:06:56
@jdduke Thanks for pointing the issue in positionA
| |
2162 if (isPastePopupShowing && !isScrollInProgress()) | |
2163 showPastePopup((int) posXDip, (int) posYDip); | |
2164 break; | |
2165 | |
2158 case SelectionEventType.INSERTION_TAPPED: | 2166 case SelectionEventType.INSERTION_TAPPED: |
2159 if (getPastePopup().isShowing()) | 2167 if (mWasPastePopupShowing) |
2160 mPastePopupMenu.hide(); | 2168 mPastePopupMenu.hide(); |
2161 else | 2169 else |
2162 showPastePopup((int) posXDip, (int) posYDip); | 2170 showPastePopup((int) posXDip, (int) posYDip); |
2163 break; | 2171 break; |
2164 | 2172 |
2165 case SelectionEventType.INSERTION_CLEARED: | 2173 case SelectionEventType.INSERTION_CLEARED: |
2166 mHasInsertion = false; | 2174 mHasInsertion = false; |
2175 mWasPastePopupShowing = false; | |
2167 hidePastePopup(); | 2176 hidePastePopup(); |
2168 break; | 2177 break; |
2169 | 2178 |
2170 default: | 2179 default: |
2171 assert false : "Invalid selection event type."; | 2180 assert false : "Invalid selection event type."; |
2172 } | 2181 } |
2173 } | 2182 } |
2174 | 2183 |
2175 public boolean getUseDesktopUserAgent() { | 2184 public boolean getUseDesktopUserAgent() { |
2176 if (mNativeContentViewCore != 0) { | 2185 if (mNativeContentViewCore != 0) { |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3228 | 3237 |
3229 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 3238 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
3230 int x, int y, int w, int h); | 3239 int x, int y, int w, int h); |
3231 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 3240 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
3232 | 3241 |
3233 private native void nativeResumeResponseDeferredAtStart( | 3242 private native void nativeResumeResponseDeferredAtStart( |
3234 long nativeContentViewCoreImpl); | 3243 long nativeContentViewCoreImpl); |
3235 private native void nativeSetHasPendingNavigationTransitionForTesting( | 3244 private native void nativeSetHasPendingNavigationTransitionForTesting( |
3236 long nativeContentViewCoreImpl); | 3245 long nativeContentViewCoreImpl); |
3237 } | 3246 } |
OLD | NEW |