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 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 } | 2317 } |
2318 | 2318 |
2319 @SuppressWarnings("unused") | 2319 @SuppressWarnings("unused") |
2320 @CalledByNative | 2320 @CalledByNative |
2321 private void updateFrameInfo( | 2321 private void updateFrameInfo( |
2322 float scrollOffsetX, float scrollOffsetY, | 2322 float scrollOffsetX, float scrollOffsetY, |
2323 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor, | 2323 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor, |
2324 float contentWidth, float contentHeight, | 2324 float contentWidth, float contentHeight, |
2325 float viewportWidth, float viewportHeight, | 2325 float viewportWidth, float viewportHeight, |
2326 float controlsOffsetYCss, float contentOffsetYCss, | 2326 float controlsOffsetYCss, float contentOffsetYCss, |
2327 boolean isMobileOptimizedHint) { | 2327 boolean isMobileOptimizedHint, |
| 2328 boolean hasInsertionMarker, boolean isInsertionMarkerVisible, |
| 2329 float insertionMarkerHorizontal, float insertionMarkerTop, |
| 2330 float insertionMarkerBottom) { |
2328 TraceEvent.begin("ContentViewCore:updateFrameInfo"); | 2331 TraceEvent.begin("ContentViewCore:updateFrameInfo"); |
2329 mIsMobileOptimizedHint = isMobileOptimizedHint; | 2332 mIsMobileOptimizedHint = isMobileOptimizedHint; |
2330 // Adjust contentWidth/Height to be always at least as big as | 2333 // Adjust contentWidth/Height to be always at least as big as |
2331 // the actual viewport (as set by onSizeChanged). | 2334 // the actual viewport (as set by onSizeChanged). |
2332 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); | 2335 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); |
2333 contentWidth = Math.max(contentWidth, | 2336 contentWidth = Math.max(contentWidth, |
2334 mViewportWidthPix / (deviceScale * pageScaleFactor)); | 2337 mViewportWidthPix / (deviceScale * pageScaleFactor)); |
2335 contentHeight = Math.max(contentHeight, | 2338 contentHeight = Math.max(contentHeight, |
2336 mViewportHeightPix / (deviceScale * pageScaleFactor)); | 2339 mViewportHeightPix / (deviceScale * pageScaleFactor)); |
2337 final float contentOffsetYPix = mRenderCoordinates.fromDipToPix(contentO
ffsetYCss); | 2340 final float contentOffsetYPix = mRenderCoordinates.fromDipToPix(contentO
ffsetYCss); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2384 | 2387 |
2385 // Update offsets for fullscreen. | 2388 // Update offsets for fullscreen. |
2386 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; | 2389 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; |
2387 // TODO(aelias): Remove last argument after downstream removes it. | 2390 // TODO(aelias): Remove last argument after downstream removes it. |
2388 getContentViewClient().onOffsetsForFullscreenChanged( | 2391 getContentViewClient().onOffsetsForFullscreenChanged( |
2389 controlsOffsetPix, contentOffsetYPix, 0); | 2392 controlsOffsetPix, contentOffsetYPix, 0); |
2390 | 2393 |
2391 if (mBrowserAccessibilityManager != null) { | 2394 if (mBrowserAccessibilityManager != null) { |
2392 mBrowserAccessibilityManager.notifyFrameInfoInitialized(); | 2395 mBrowserAccessibilityManager.notifyFrameInfoInitialized(); |
2393 } | 2396 } |
| 2397 |
| 2398 mImeAdapter.onUpdateFrameInfo(mRenderCoordinates, hasInsertionMarker, |
| 2399 isInsertionMarkerVisible, insertionMarkerHorizontal, insertionMa
rkerTop, |
| 2400 insertionMarkerBottom); |
| 2401 |
2394 TraceEvent.end("ContentViewCore:updateFrameInfo"); | 2402 TraceEvent.end("ContentViewCore:updateFrameInfo"); |
2395 } | 2403 } |
2396 | 2404 |
2397 @CalledByNative | 2405 @CalledByNative |
2398 private void updateImeAdapter(long nativeImeAdapterAndroid, int textInputTyp
e, | 2406 private void updateImeAdapter(long nativeImeAdapterAndroid, int textInputTyp
e, |
2399 int textInputFlags, String text, int selectionStart, int selectionEn
d, | 2407 int textInputFlags, String text, int selectionStart, int selectionEn
d, |
2400 int compositionStart, int compositionEnd, boolean showImeIfNeeded, | 2408 int compositionStart, int compositionEnd, boolean showImeIfNeeded, |
2401 boolean isNonImeChange) { | 2409 boolean isNonImeChange) { |
2402 try { | 2410 try { |
2403 TraceEvent.begin("ContentViewCore.updateImeAdapter"); | 2411 TraceEvent.begin("ContentViewCore.updateImeAdapter"); |
2404 mFocusedNodeEditable = (textInputType != TextInputType.NONE); | 2412 mFocusedNodeEditable = (textInputType != TextInputType.NONE); |
2405 if (!mFocusedNodeEditable) hidePastePopup(); | 2413 if (!mFocusedNodeEditable) hidePastePopup(); |
2406 | 2414 |
| 2415 mImeAdapter.updateTextAndSelection(text, selectionStart, selectionEn
d, compositionStart, |
| 2416 compositionEnd); |
| 2417 |
2407 mImeAdapter.updateKeyboardVisibility( | 2418 mImeAdapter.updateKeyboardVisibility( |
2408 nativeImeAdapterAndroid, textInputType, textInputFlags, show
ImeIfNeeded); | 2419 nativeImeAdapterAndroid, textInputType, textInputFlags, show
ImeIfNeeded); |
2409 | 2420 |
2410 if (mInputConnection != null) { | 2421 if (mInputConnection != null) { |
2411 mInputConnection.updateState(text, selectionStart, selectionEnd,
compositionStart, | 2422 mInputConnection.updateState(text, selectionStart, selectionEnd,
compositionStart, |
2412 compositionEnd, isNonImeChange); | 2423 compositionEnd, isNonImeChange); |
2413 } | 2424 } |
2414 | 2425 |
2415 if (mActionMode != null) mActionMode.invalidate(); | 2426 if (mActionMode != null) mActionMode.invalidate(); |
2416 } finally { | 2427 } finally { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3360 String textTrackFontVariant, String textTrackTextColor, String textT
rackTextShadow, | 3371 String textTrackFontVariant, String textTrackTextColor, String textT
rackTextShadow, |
3361 String textTrackTextSize); | 3372 String textTrackTextSize); |
3362 | 3373 |
3363 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3374 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
3364 int x, int y, int w, int h); | 3375 int x, int y, int w, int h); |
3365 | 3376 |
3366 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 3377 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
3367 | 3378 |
3368 private native void nativeSetDrawsContent(long nativeContentViewCoreImpl, bo
olean draws); | 3379 private native void nativeSetDrawsContent(long nativeContentViewCoreImpl, bo
olean draws); |
3369 } | 3380 } |
OLD | NEW |