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.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.app.SearchManager; | 10 import android.app.SearchManager; |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 updateGestureStateListener(GestureEventType.PINCH_END); | 1243 updateGestureStateListener(GestureEventType.PINCH_END); |
1244 } | 1244 } |
1245 | 1245 |
1246 @SuppressWarnings("unused") | 1246 @SuppressWarnings("unused") |
1247 @CalledByNative | 1247 @CalledByNative |
1248 private void onSingleTapEventAck(boolean consumed, int x, int y) { | 1248 private void onSingleTapEventAck(boolean consumed, int x, int y) { |
1249 for (mGestureStateListenersIterator.rewind(); | 1249 for (mGestureStateListenersIterator.rewind(); |
1250 mGestureStateListenersIterator.hasNext();) { | 1250 mGestureStateListenersIterator.hasNext();) { |
1251 mGestureStateListenersIterator.next().onSingleTap(consumed, x, y); | 1251 mGestureStateListenersIterator.next().onSingleTap(consumed, x, y); |
1252 } | 1252 } |
| 1253 hidePastePopup(); |
1253 } | 1254 } |
1254 | 1255 |
1255 @SuppressWarnings("unused") | 1256 @SuppressWarnings("unused") |
1256 @CalledByNative | 1257 @CalledByNative |
1257 private void onShowUnhandledTapUIIfNeeded(int x, int y) { | 1258 private void onShowUnhandledTapUIIfNeeded(int x, int y) { |
1258 if (mContextualSearchClient != null) { | 1259 if (mContextualSearchClient != null) { |
1259 mContextualSearchClient.showUnhandledTapUIIfNeeded(x, y); | 1260 mContextualSearchClient.showUnhandledTapUIIfNeeded(x, y); |
1260 } | 1261 } |
1261 } | 1262 } |
1262 | 1263 |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 hidePastePopup(); | 2235 hidePastePopup(); |
2235 } | 2236 } |
2236 break; | 2237 break; |
2237 | 2238 |
2238 case SelectionEventType.INSERTION_HANDLE_TAPPED: | 2239 case SelectionEventType.INSERTION_HANDLE_TAPPED: |
2239 if (mWasPastePopupShowingOnInsertionDragStart) { | 2240 if (mWasPastePopupShowingOnInsertionDragStart) { |
2240 hidePastePopup(); | 2241 hidePastePopup(); |
2241 } else { | 2242 } else { |
2242 showPastePopup(xAnchor, yAnchor); | 2243 showPastePopup(xAnchor, yAnchor); |
2243 } | 2244 } |
| 2245 mWasPastePopupShowingOnInsertionDragStart = false; |
2244 break; | 2246 break; |
2245 | 2247 |
2246 case SelectionEventType.INSERTION_HANDLE_CLEARED: | 2248 case SelectionEventType.INSERTION_HANDLE_CLEARED: |
2247 hidePastePopup(); | 2249 hidePastePopup(); |
2248 mHasInsertion = false; | 2250 mHasInsertion = false; |
2249 mSelectionRect.setEmpty(); | 2251 mSelectionRect.setEmpty(); |
2250 break; | 2252 break; |
2251 | 2253 |
2252 case SelectionEventType.INSERTION_HANDLE_DRAG_STARTED: | 2254 case SelectionEventType.INSERTION_HANDLE_DRAG_STARTED: |
2253 mWasPastePopupShowingOnInsertionDragStart = isPastePopupShowing(
); | 2255 mWasPastePopupShowingOnInsertionDragStart = isPastePopupShowing(
); |
2254 hidePastePopup(); | 2256 hidePastePopup(); |
2255 break; | 2257 break; |
2256 | 2258 |
2257 case SelectionEventType.INSERTION_HANDLE_DRAG_STOPPED: | 2259 case SelectionEventType.INSERTION_HANDLE_DRAG_STOPPED: |
| 2260 if (mWasPastePopupShowingOnInsertionDragStart) { |
| 2261 showPastePopup(xAnchor, yAnchor); |
| 2262 } |
| 2263 mWasPastePopupShowingOnInsertionDragStart = false; |
| 2264 break; |
2258 case SelectionEventType.SELECTION_ESTABLISHED: | 2265 case SelectionEventType.SELECTION_ESTABLISHED: |
2259 case SelectionEventType.SELECTION_DISSOLVED: | 2266 case SelectionEventType.SELECTION_DISSOLVED: |
2260 break; | 2267 break; |
2261 | 2268 |
2262 default: | 2269 default: |
2263 assert false : "Invalid selection event type."; | 2270 assert false : "Invalid selection event type."; |
2264 } | 2271 } |
2265 if (mContextualSearchClient != null) { | 2272 if (mContextualSearchClient != null) { |
2266 mContextualSearchClient.onSelectionEvent(eventType, xAnchor, yAnchor
); | 2273 mContextualSearchClient.onSelectionEvent(eventType, xAnchor, yAnchor
); |
2267 } | 2274 } |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3289 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp
l, | 3296 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp
l, |
3290 boolean textTracksEnabled, String textTrackBackgroundColor, String t
extTrackFontFamily, | 3297 boolean textTracksEnabled, String textTrackBackgroundColor, String t
extTrackFontFamily, |
3291 String textTrackFontStyle, String textTrackFontVariant, String textT
rackTextColor, | 3298 String textTrackFontStyle, String textTrackFontVariant, String textT
rackTextColor, |
3292 String textTrackTextShadow, String textTrackTextSize); | 3299 String textTrackTextShadow, String textTrackTextSize); |
3293 | 3300 |
3294 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3301 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
3295 int x, int y, int w, int h); | 3302 int x, int y, int w, int h); |
3296 | 3303 |
3297 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 3304 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
3298 } | 3305 } |
OLD | NEW |