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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 private int mViewportWidthPix; | 418 private int mViewportWidthPix; |
419 private int mViewportHeightPix; | 419 private int mViewportHeightPix; |
420 private int mPhysicalBackingWidthPix; | 420 private int mPhysicalBackingWidthPix; |
421 private int mPhysicalBackingHeightPix; | 421 private int mPhysicalBackingHeightPix; |
422 private int mTopControlsHeightPix; | 422 private int mTopControlsHeightPix; |
423 private boolean mTopControlsShrinkBlinkSize; | 423 private boolean mTopControlsShrinkBlinkSize; |
424 | 424 |
425 // Cached copy of all positions and scales as reported by the renderer. | 425 // Cached copy of all positions and scales as reported by the renderer. |
426 private final RenderCoordinates mRenderCoordinates; | 426 private final RenderCoordinates mRenderCoordinates; |
427 | 427 |
| 428 // Buffer to receive return value from View#getLocationOnScreen(int[]). |
| 429 private final int[] mGetLocationOnScreenBuffer = new int[2]; |
| 430 |
428 // Tracks whether a selection is currently active. When applied to selected
text, indicates | 431 // Tracks whether a selection is currently active. When applied to selected
text, indicates |
429 // whether the last selected text is still highlighted. | 432 // whether the last selected text is still highlighted. |
430 private boolean mHasSelection; | 433 private boolean mHasSelection; |
431 private boolean mHasInsertion; | 434 private boolean mHasInsertion; |
432 private String mLastSelectedText; | 435 private String mLastSelectedText; |
433 private boolean mFocusedNodeEditable; | 436 private boolean mFocusedNodeEditable; |
434 private ActionMode mActionMode; | 437 private ActionMode mActionMode; |
435 private boolean mUnselectAllOnActionModeDismiss; | 438 private boolean mUnselectAllOnActionModeDismiss; |
436 private boolean mPreserveSelectionOnNextLossOfFocus; | 439 private boolean mPreserveSelectionOnNextLossOfFocus; |
437 private SelectActionModeCallback.ActionHandler mActionHandler; | 440 private SelectActionModeCallback.ActionHandler mActionHandler; |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3066 } | 3069 } |
3067 | 3070 |
3068 /** | 3071 /** |
3069 * Sets the client to use for Contextual Search functionality. | 3072 * Sets the client to use for Contextual Search functionality. |
3070 * @param contextualSearchClient The client to notify for Contextual Search
operations. | 3073 * @param contextualSearchClient The client to notify for Contextual Search
operations. |
3071 */ | 3074 */ |
3072 public void setContextualSearchClient(ContextualSearchClient contextualSearc
hClient) { | 3075 public void setContextualSearchClient(ContextualSearchClient contextualSearc
hClient) { |
3073 mContextualSearchClient = contextualSearchClient; | 3076 mContextualSearchClient = contextualSearchClient; |
3074 } | 3077 } |
3075 | 3078 |
| 3079 @CalledByNative |
| 3080 private long getLocationOnScreen() { |
| 3081 // TODO(yukawa): ViewPositionObserver has similar logic. Try to merge th
em. |
| 3082 mContainerView.getLocationInWindow(mGetLocationOnScreenBuffer); |
| 3083 return ((long) mGetLocationOnScreenBuffer[0]) << 32 | mGetLocationOnScre
enBuffer[1]; |
| 3084 } |
| 3085 |
3076 private native WebContents nativeGetWebContentsAndroid(long nativeContentVie
wCoreImpl); | 3086 private native WebContents nativeGetWebContentsAndroid(long nativeContentVie
wCoreImpl); |
3077 | 3087 |
3078 private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentV
iewCoreImpl); | 3088 private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentV
iewCoreImpl); |
3079 | 3089 |
3080 private native void nativeSetFocus(long nativeContentViewCoreImpl, boolean f
ocused); | 3090 private native void nativeSetFocus(long nativeContentViewCoreImpl, boolean f
ocused); |
3081 | 3091 |
3082 private native void nativeSendOrientationChangeEvent( | 3092 private native void nativeSendOrientationChangeEvent( |
3083 long nativeContentViewCoreImpl, int orientation); | 3093 long nativeContentViewCoreImpl, int orientation); |
3084 | 3094 |
3085 // All touch events (including flings, scrolls etc) accept coordinates in ph
ysical pixels. | 3095 // All touch events (including flings, scrolls etc) accept coordinates in ph
ysical pixels. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 private native void nativeWasResized(long nativeContentViewCoreImpl); | 3182 private native void nativeWasResized(long nativeContentViewCoreImpl); |
3173 | 3183 |
3174 private native void nativeSetAccessibilityEnabled( | 3184 private native void nativeSetAccessibilityEnabled( |
3175 long nativeContentViewCoreImpl, boolean enabled); | 3185 long nativeContentViewCoreImpl, boolean enabled); |
3176 | 3186 |
3177 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3187 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
3178 int x, int y, int w, int h); | 3188 int x, int y, int w, int h); |
3179 | 3189 |
3180 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 3190 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
3181 } | 3191 } |
OLD | NEW |