| 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.app.SearchManager; | 8 import android.app.SearchManager; |
| 9 import android.content.ContentResolver; | 9 import android.content.ContentResolver; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 mZoomControlsDelegate = new ZoomControlsDelegate() { | 778 mZoomControlsDelegate = new ZoomControlsDelegate() { |
| 779 @Override | 779 @Override |
| 780 public void invokeZoomPicker() {} | 780 public void invokeZoomPicker() {} |
| 781 @Override | 781 @Override |
| 782 public void dismissZoomPicker() {} | 782 public void dismissZoomPicker() {} |
| 783 @Override | 783 @Override |
| 784 public void updateZoomControls() {} | 784 public void updateZoomControls() {} |
| 785 }; | 785 }; |
| 786 | 786 |
| 787 mRenderCoordinates.reset(); | 787 mRenderCoordinates.reset(); |
| 788 onRenderCoordinatesUpdated(); |
| 788 | 789 |
| 789 initPopupZoomer(mContext); | 790 initPopupZoomer(mContext); |
| 790 mImeAdapter = createImeAdapter(mContext); | 791 mImeAdapter = createImeAdapter(mContext); |
| 791 TraceEvent.end(); | 792 TraceEvent.end(); |
| 792 } | 793 } |
| 793 | 794 |
| 794 private void initPopupZoomer(Context context){ | 795 private void initPopupZoomer(Context context){ |
| 795 mPopupZoomer = new PopupZoomer(context); | 796 mPopupZoomer = new PopupZoomer(context); |
| 796 mPopupZoomer.setOnVisibilityChangedListener(new PopupZoomer.OnVisibility
ChangedListener() { | 797 mPopupZoomer.setOnVisibilityChangedListener(new PopupZoomer.OnVisibility
ChangedListener() { |
| 797 @Override | 798 @Override |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 public ContentSettings getContentSettings() { | 1427 public ContentSettings getContentSettings() { |
| 1427 return mContentSettings; | 1428 return mContentSettings; |
| 1428 } | 1429 } |
| 1429 | 1430 |
| 1430 @Override | 1431 @Override |
| 1431 public boolean didUIStealScroll(float x, float y) { | 1432 public boolean didUIStealScroll(float x, float y) { |
| 1432 return getContentViewClient().shouldOverrideScroll( | 1433 return getContentViewClient().shouldOverrideScroll( |
| 1433 x, y, computeHorizontalScrollOffset(), computeVerticalScrollOffs
et()); | 1434 x, y, computeHorizontalScrollOffset(), computeVerticalScrollOffs
et()); |
| 1434 } | 1435 } |
| 1435 | 1436 |
| 1436 @Override | 1437 private void onRenderCoordinatesUpdated() { |
| 1437 public boolean hasFixedPageScale() { | 1438 if (mContentViewGestureHandler == null) return; |
| 1438 return mRenderCoordinates.hasFixedPageScale(); | 1439 mContentViewGestureHandler.updateHasFixedPageScale(mRenderCoordinates.ha
sFixedPageScale()); |
| 1439 } | 1440 } |
| 1440 | 1441 |
| 1441 private void hidePopupDialog() { | 1442 private void hidePopupDialog() { |
| 1442 SelectPopupDialog.hide(this); | 1443 SelectPopupDialog.hide(this); |
| 1443 hideHandles(); | 1444 hideHandles(); |
| 1444 hideSelectActionBar(); | 1445 hideSelectActionBar(); |
| 1445 } | 1446 } |
| 1446 | 1447 |
| 1447 void hideSelectActionBar() { | 1448 void hideSelectActionBar() { |
| 1448 if (mActionMode != null) { | 1449 if (mActionMode != null) { |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 } | 1931 } |
| 1931 | 1932 |
| 1932 public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegat
e) { | 1933 public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegat
e) { |
| 1933 mZoomControlsDelegate = zoomControlsDelegate; | 1934 mZoomControlsDelegate = zoomControlsDelegate; |
| 1934 } | 1935 } |
| 1935 | 1936 |
| 1936 public void updateMultiTouchZoomSupport(boolean supportsMultiTouchZoom) { | 1937 public void updateMultiTouchZoomSupport(boolean supportsMultiTouchZoom) { |
| 1937 mZoomManager.updateMultiTouchSupport(supportsMultiTouchZoom); | 1938 mZoomManager.updateMultiTouchSupport(supportsMultiTouchZoom); |
| 1938 } | 1939 } |
| 1939 | 1940 |
| 1940 public void updateDoubleTapDragSupport(boolean supportsDoubleTapDrag) { | 1941 public void updateDoubleTapSupport(boolean supportsDoubleTap) { |
| 1941 mContentViewGestureHandler.updateDoubleTapDragSupport(supportsDoubleTapD
rag); | 1942 mContentViewGestureHandler.updateDoubleTapSupport(supportsDoubleTap); |
| 1942 } | 1943 } |
| 1943 | 1944 |
| 1944 public void selectPopupMenuItems(int[] indices) { | 1945 public void selectPopupMenuItems(int[] indices) { |
| 1945 if (mNativeContentViewCore != 0) { | 1946 if (mNativeContentViewCore != 0) { |
| 1946 nativeSelectPopupMenuItems(mNativeContentViewCore, indices); | 1947 nativeSelectPopupMenuItems(mNativeContentViewCore, indices); |
| 1947 } | 1948 } |
| 1948 } | 1949 } |
| 1949 | 1950 |
| 1950 /** | 1951 /** |
| 1951 * Get the screen orientation from the OS and push it to WebKit. | 1952 * Get the screen orientation from the OS and push it to WebKit. |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 final boolean needTemporarilyHideHandles = scrollChanged; | 2359 final boolean needTemporarilyHideHandles = scrollChanged; |
| 2359 | 2360 |
| 2360 if (needHidePopupZoomer) mPopupZoomer.hide(true); | 2361 if (needHidePopupZoomer) mPopupZoomer.hide(true); |
| 2361 | 2362 |
| 2362 mRenderCoordinates.updateFrameInfo( | 2363 mRenderCoordinates.updateFrameInfo( |
| 2363 scrollOffsetX, scrollOffsetY, | 2364 scrollOffsetX, scrollOffsetY, |
| 2364 contentWidth, contentHeight, | 2365 contentWidth, contentHeight, |
| 2365 viewportWidth, viewportHeight, | 2366 viewportWidth, viewportHeight, |
| 2366 pageScaleFactor, minPageScaleFactor, maxPageScaleFactor, | 2367 pageScaleFactor, minPageScaleFactor, maxPageScaleFactor, |
| 2367 contentOffsetYPix); | 2368 contentOffsetYPix); |
| 2369 onRenderCoordinatesUpdated(); |
| 2368 | 2370 |
| 2369 if (needTemporarilyHideHandles) temporarilyHideTextHandles(); | 2371 if (needTemporarilyHideHandles) temporarilyHideTextHandles(); |
| 2370 if (needUpdateZoomControls) mZoomControlsDelegate.updateZoomControls(); | 2372 if (needUpdateZoomControls) mZoomControlsDelegate.updateZoomControls(); |
| 2371 if (contentOffsetChanged) updateHandleScreenPositions(); | 2373 if (contentOffsetChanged) updateHandleScreenPositions(); |
| 2372 | 2374 |
| 2373 // Update offsets for fullscreen. | 2375 // Update offsets for fullscreen. |
| 2374 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); | 2376 final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); |
| 2375 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; | 2377 final float controlsOffsetPix = controlsOffsetYCss * deviceScale; |
| 2376 final float overdrawBottomHeightPix = overdrawBottomHeightCss * deviceSc
ale; | 2378 final float overdrawBottomHeightPix = overdrawBottomHeightCss * deviceSc
ale; |
| 2377 getContentViewClient().onOffsetsForFullscreenChanged( | 2379 getContentViewClient().onOffsetsForFullscreenChanged( |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3259 | 3261 |
| 3260 private native void nativeAttachExternalVideoSurface( | 3262 private native void nativeAttachExternalVideoSurface( |
| 3261 int nativeContentViewCoreImpl, int playerId, Surface surface); | 3263 int nativeContentViewCoreImpl, int playerId, Surface surface); |
| 3262 | 3264 |
| 3263 private native void nativeDetachExternalVideoSurface( | 3265 private native void nativeDetachExternalVideoSurface( |
| 3264 int nativeContentViewCoreImpl, int playerId); | 3266 int nativeContentViewCoreImpl, int playerId); |
| 3265 | 3267 |
| 3266 private native void nativeSetAccessibilityEnabled( | 3268 private native void nativeSetAccessibilityEnabled( |
| 3267 int nativeContentViewCoreImpl, boolean enabled); | 3269 int nativeContentViewCoreImpl, boolean enabled); |
| 3268 } | 3270 } |
| OLD | NEW |