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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
457 private PastePopupMenu mPastePopupMenu; | 457 private PastePopupMenu mPastePopupMenu; |
458 private boolean mWasPastePopupShowingOnInsertionDragStart; | 458 private boolean mWasPastePopupShowingOnInsertionDragStart; |
459 | 459 |
460 // Size of the viewport in physical pixels as set from onSizeChanged. | 460 // Size of the viewport in physical pixels as set from onSizeChanged. |
461 private int mViewportWidthPix; | 461 private int mViewportWidthPix; |
462 private int mViewportHeightPix; | 462 private int mViewportHeightPix; |
463 private int mPhysicalBackingWidthPix; | 463 private int mPhysicalBackingWidthPix; |
464 private int mPhysicalBackingHeightPix; | 464 private int mPhysicalBackingHeightPix; |
465 private int mTopControlsHeightPix; | 465 private int mTopControlsHeightPix; |
466 private boolean mTopControlsShrinkBlinkSize; | 466 private boolean mTopControlsShrinkBlinkSize; |
467 private Rect mWindowInsets; | |
aelias_OOO_until_Jul13
2016/02/24 02:43:59
As I mentioned in #31, I'd like this to be stored
ymalik
2016/03/03 02:10:18
Done.
| |
467 | 468 |
468 // Cached copy of all positions and scales as reported by the renderer. | 469 // Cached copy of all positions and scales as reported by the renderer. |
469 private final RenderCoordinates mRenderCoordinates; | 470 private final RenderCoordinates mRenderCoordinates; |
470 | 471 |
471 // Provides smooth gamepad joystick-driven scrolling. | 472 // Provides smooth gamepad joystick-driven scrolling. |
472 private final JoystickScrollProvider mJoystickScrollProvider; | 473 private final JoystickScrollProvider mJoystickScrollProvider; |
473 | 474 |
474 private boolean mIsMobileOptimizedHint; | 475 private boolean mIsMobileOptimizedHint; |
475 | 476 |
476 // Tracks whether a selection is currently active. When applied to selected text, indicates | 477 // Tracks whether a selection is currently active. When applied to selected text, indicates |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
594 deviceScaleFactor = Float.valueOf(forceScaleFactor); | 595 deviceScaleFactor = Float.valueOf(forceScaleFactor); |
595 } | 596 } |
596 mRenderCoordinates.setDeviceScaleFactor(deviceScaleFactor); | 597 mRenderCoordinates.setDeviceScaleFactor(deviceScaleFactor); |
597 mAccessibilityManager = (AccessibilityManager) | 598 mAccessibilityManager = (AccessibilityManager) |
598 getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); | 599 getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); |
599 mSystemCaptioningBridge = CaptioningBridgeFactory.getSystemCaptioningBri dge(mContext); | 600 mSystemCaptioningBridge = CaptioningBridgeFactory.getSystemCaptioningBri dge(mContext); |
600 mGestureStateListeners = new ObserverList<GestureStateListener>(); | 601 mGestureStateListeners = new ObserverList<GestureStateListener>(); |
601 mGestureStateListenersIterator = mGestureStateListeners.rewindableIterat or(); | 602 mGestureStateListenersIterator = mGestureStateListeners.rewindableIterat or(); |
602 | 603 |
603 mContainerViewObservers = new ObserverList<ContainerViewObserver>(); | 604 mContainerViewObservers = new ObserverList<ContainerViewObserver>(); |
605 | |
606 mWindowInsets = new Rect(); | |
604 } | 607 } |
605 | 608 |
606 /** | 609 /** |
607 * @return The context used for creating this ContentViewCore. | 610 * @return The context used for creating this ContentViewCore. |
608 */ | 611 */ |
609 @CalledByNative | 612 @CalledByNative |
610 public Context getContext() { | 613 public Context getContext() { |
611 return mContext; | 614 return mContext; |
612 } | 615 } |
613 | 616 |
614 /** | 617 /** |
615 * @return The ViewGroup that all view actions of this ContentViewCore shoul d interact with. | 618 * @return The ViewGroup that all view actions of this ContentViewCore shoul d interact with. |
616 */ | 619 */ |
617 public ViewGroup getContainerView() { | 620 public ViewGroup getContainerView() { |
618 return mContainerView; | 621 return mContainerView; |
619 } | 622 } |
620 | 623 |
621 /** | 624 /** |
625 * @return The system window insets (from OSK, status bar, etc). | |
626 */ | |
627 private Rect getWindowInsets() { | |
628 return mWindowInsets != null ? mWindowInsets : new Rect(); | |
629 } | |
630 | |
631 /** | |
632 * Set the window insets Rect to the specified values. | |
633 * | |
634 * @param left The left window inset | |
635 * @param top The top window inset. | |
636 * @param right The right window inset. | |
637 * @param bottom The bottom window inset. | |
638 */ | |
639 public void setWindowInsets(int left, int top, int right, int bottom) { | |
640 mWindowInsets.set(left, top, right, bottom); | |
641 } | |
642 | |
643 /** | |
622 * @return The WebContents currently being rendered. | 644 * @return The WebContents currently being rendered. |
623 */ | 645 */ |
624 public WebContents getWebContents() { | 646 public WebContents getWebContents() { |
625 return mWebContents; | 647 return mWebContents; |
626 } | 648 } |
627 | 649 |
628 /** | 650 /** |
629 * @return The WindowAndroid associated with this ContentViewCore. | 651 * @return The WindowAndroid associated with this ContentViewCore. |
630 */ | 652 */ |
631 public WindowAndroid getWindowAndroid() { | 653 public WindowAndroid getWindowAndroid() { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 | 1032 |
1011 /** | 1033 /** |
1012 * @return Viewport height in physical pixels as set from onSizeChanged. | 1034 * @return Viewport height in physical pixels as set from onSizeChanged. |
1013 */ | 1035 */ |
1014 @CalledByNative | 1036 @CalledByNative |
1015 public int getViewportHeightPix() { | 1037 public int getViewportHeightPix() { |
1016 return mViewportHeightPix; | 1038 return mViewportHeightPix; |
1017 } | 1039 } |
1018 | 1040 |
1019 /** | 1041 /** |
1042 * @return Viewport height when the OSK is hidden in physical pixels as set from onSizeChanged. | |
1043 */ | |
1044 @CalledByNative | |
1045 public int getViewportHeightWithOSKHiddenPix() { | |
1046 return mViewportHeightPix + getWindowInsets().bottom; | |
1047 } | |
1048 | |
1049 /** | |
1020 * @return Width of underlying physical surface. | 1050 * @return Width of underlying physical surface. |
1021 */ | 1051 */ |
1022 @CalledByNative | 1052 @CalledByNative |
1023 private int getPhysicalBackingWidthPix() { | 1053 private int getPhysicalBackingWidthPix() { |
1024 return mPhysicalBackingWidthPix; | 1054 return mPhysicalBackingWidthPix; |
1025 } | 1055 } |
1026 | 1056 |
1027 /** | 1057 /** |
1028 * @return Height of underlying physical surface. | 1058 * @return Height of underlying physical surface. |
1029 */ | 1059 */ |
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3296 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp l, | 3326 private native void nativeSetTextTrackSettings(long nativeContentViewCoreImp l, |
3297 boolean textTracksEnabled, String textTrackBackgroundColor, String t extTrackFontFamily, | 3327 boolean textTracksEnabled, String textTrackBackgroundColor, String t extTrackFontFamily, |
3298 String textTrackFontStyle, String textTrackFontVariant, String textT rackTextColor, | 3328 String textTrackFontStyle, String textTrackFontVariant, String textT rackTextColor, |
3299 String textTrackTextShadow, String textTrackTextSize); | 3329 String textTrackTextShadow, String textTrackTextSize); |
3300 | 3330 |
3301 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 3331 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
3302 int x, int y, int w, int h); | 3332 int x, int y, int w, int h); |
3303 | 3333 |
3304 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 3334 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
3305 } | 3335 } |
OLD | NEW |