| 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 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 } | 2310 } |
| 2311 | 2311 |
| 2312 @SuppressWarnings("unused") | 2312 @SuppressWarnings("unused") |
| 2313 @CalledByNative | 2313 @CalledByNative |
| 2314 private void updateFrameInfo( | 2314 private void updateFrameInfo( |
| 2315 float scrollOffsetX, float scrollOffsetY, | 2315 float scrollOffsetX, float scrollOffsetY, |
| 2316 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor, | 2316 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor, |
| 2317 float contentWidth, float contentHeight, | 2317 float contentWidth, float contentHeight, |
| 2318 float viewportWidth, float viewportHeight, | 2318 float viewportWidth, float viewportHeight, |
| 2319 float controlsOffsetYCss, float contentOffsetYCss, | 2319 float controlsOffsetYCss, float contentOffsetYCss, |
| 2320 boolean isMobileOptimizedHint) { | 2320 boolean isMobileOptimizedHint, |
| 2321 boolean hasInsertionMarker, boolean isInsertionMarkerVisible, |
| 2322 float insertionMarkerHorizontal, float insertionMarkerTop, |
| 2323 float insertionMarkerBottom) { |
| 2321 TraceEvent.begin("ContentViewCore:updateFrameInfo"); | 2324 TraceEvent.begin("ContentViewCore:updateFrameInfo"); |
| 2322 mIsMobileOptimizedHint = isMobileOptimizedHint; | 2325 mIsMobileOptimizedHint = isMobileOptimizedHint; |
| 2323 // Adjust contentWidth/Height to be always at least as big as | 2326 // Adjust contentWidth/Height to be always at least as big as |
| 2324 // the actual viewport (as set by onSizeChanged). | 2327 // the actual viewport (as set by onSizeChanged). |
| 2325 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); | 2328 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); |
| 2326 contentWidth = Math.max(contentWidth, | 2329 contentWidth = Math.max(contentWidth, |
| 2327 mViewportWidthPix / (deviceScale * pageScaleFactor)); | 2330 mViewportWidthPix / (deviceScale * pageScaleFactor)); |
| 2328 contentHeight = Math.max(contentHeight, | 2331 contentHeight = Math.max(contentHeight, |
| 2329 mViewportHeightPix / (deviceScale * pageScaleFactor)); | 2332 mViewportHeightPix / (deviceScale * pageScaleFactor)); |
| 2330 final float contentOffsetYPix = mRenderCoordinates.fromDipToPix(contentO
ffsetYCss); | 2333 final float contentOffsetYPix = mRenderCoordinates.fromDipToPix(contentO
ffsetYCss); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2377 | 2380 |
| 2378 // Update offsets for fullscreen. | 2381 // Update offsets for fullscreen. |
| 2379 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; | 2382 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; |
| 2380 // TODO(aelias): Remove last argument after downstream removes it. | 2383 // TODO(aelias): Remove last argument after downstream removes it. |
| 2381 getContentViewClient().onOffsetsForFullscreenChanged( | 2384 getContentViewClient().onOffsetsForFullscreenChanged( |
| 2382 controlsOffsetPix, contentOffsetYPix); | 2385 controlsOffsetPix, contentOffsetYPix); |
| 2383 | 2386 |
| 2384 if (mBrowserAccessibilityManager != null) { | 2387 if (mBrowserAccessibilityManager != null) { |
| 2385 mBrowserAccessibilityManager.notifyFrameInfoInitialized(); | 2388 mBrowserAccessibilityManager.notifyFrameInfoInitialized(); |
| 2386 } | 2389 } |
| 2390 |
| 2391 mImeAdapter.onUpdateFrameInfo(mRenderCoordinates, hasInsertionMarker, |
| 2392 isInsertionMarkerVisible, insertionMarkerHorizontal, insertionMa
rkerTop, |
| 2393 insertionMarkerBottom); |
| 2394 |
| 2387 TraceEvent.end("ContentViewCore:updateFrameInfo"); | 2395 TraceEvent.end("ContentViewCore:updateFrameInfo"); |
| 2388 } | 2396 } |
| 2389 | 2397 |
| 2390 @CalledByNative | 2398 @CalledByNative |
| 2391 private void updateImeAdapter(long nativeImeAdapterAndroid, int textInputTyp
e, | 2399 private void updateImeAdapter(long nativeImeAdapterAndroid, int textInputTyp
e, |
| 2392 int textInputFlags, String text, int selectionStart, int selectionEn
d, | 2400 int textInputFlags, String text, int selectionStart, int selectionEn
d, |
| 2393 int compositionStart, int compositionEnd, boolean showImeIfNeeded, | 2401 int compositionStart, int compositionEnd, boolean showImeIfNeeded, |
| 2394 boolean isNonImeChange) { | 2402 boolean isNonImeChange) { |
| 2395 try { | 2403 try { |
| 2396 TraceEvent.begin("ContentViewCore.updateImeAdapter"); | 2404 TraceEvent.begin("ContentViewCore.updateImeAdapter"); |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp
l, | 3332 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp
l, |
| 3325 boolean textTracksEnabled, String textTrackBackgroundColor, String t
extTrackFontFamily, | 3333 boolean textTracksEnabled, String textTrackBackgroundColor, String t
extTrackFontFamily, |
| 3326 String textTrackFontStyle, String textTrackFontVariant, String textT
rackTextColor, | 3334 String textTrackFontStyle, String textTrackFontVariant, String textT
rackTextColor, |
| 3327 String textTrackTextShadow, String textTrackTextSize); | 3335 String textTrackTextShadow, String textTrackTextSize); |
| 3328 | 3336 |
| 3329 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3337 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
| 3330 int x, int y, int w, int h); | 3338 int x, int y, int w, int h); |
| 3331 | 3339 |
| 3332 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 3340 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
| 3333 } | 3341 } |
| OLD | NEW |