use of org.chromium.content.browser.ContentViewCore in project AndroidChromium by JackyAndroid.
the class LocationSettings method canSitesRequestLocationPermission.
@CalledByNative
private static boolean canSitesRequestLocationPermission(WebContents webContents) {
ContentViewCore cvc = ContentViewCore.fromWebContents(webContents);
if (cvc == null)
return false;
WindowAndroid windowAndroid = cvc.getWindowAndroid();
if (windowAndroid == null)
return false;
LocationUtils locationUtils = LocationUtils.getInstance();
if (!locationUtils.isSystemLocationSettingEnabled())
return false;
return locationUtils.hasAndroidLocationPermission() || windowAndroid.canRequestPermission(Manifest.permission.ACCESS_FINE_LOCATION);
}
use of org.chromium.content.browser.ContentViewCore in project AndroidChromium by JackyAndroid.
the class ChromeFullscreenManager method updateContentViewChildrenState.
@Override
public void updateContentViewChildrenState() {
ContentViewCore contentViewCore = getActiveContentViewCore();
if (contentViewCore == null)
return;
ViewGroup view = contentViewCore.getContainerView();
float topViewsTranslation = (getControlOffset() + mControlContainerHeight);
applyTranslationToTopChildViews(view, topViewsTranslation);
applyMarginToFullChildViews(view, topViewsTranslation);
updateContentViewViewportSize(contentViewCore);
}
use of org.chromium.content.browser.ContentViewCore in project AndroidChromium by JackyAndroid.
the class Tab method swapWebContents.
/** This is currently called when committing a pre-rendered page. */
@VisibleForTesting
@CalledByNative
public void swapWebContents(WebContents webContents, boolean didStartLoad, boolean didFinishLoad) {
ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext, PRODUCT_VERSION);
ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
cv.setContentDescription(mThemedApplicationContext.getResources().getString(R.string.accessibility_content_view));
cvc.initialize(ViewAndroidDelegate.createBasicDelegate(cv), cv, webContents, getWindowAndroid());
swapContentViewCore(cvc, false, didStartLoad, didFinishLoad);
}
use of org.chromium.content.browser.ContentViewCore in project AndroidChromium by JackyAndroid.
the class Tab method updateAccessibilityVisibility.
/**
* Update whether or not the current native tab and/or web contents are
* currently visible (from an accessibility perspective), or whether
* they're obscured by another view.
*/
public void updateAccessibilityVisibility() {
View view = getView();
if (view != null) {
int importantForAccessibility = isObscuredByAnotherViewForAccessibility() ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : View.IMPORTANT_FOR_ACCESSIBILITY_YES;
if (view.getImportantForAccessibility() != importantForAccessibility) {
view.setImportantForAccessibility(importantForAccessibility);
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}
}
ContentViewCore cvc = getContentViewCore();
if (cvc != null) {
boolean isWebContentObscured = isObscuredByAnotherViewForAccessibility() || isShowingSadTab();
cvc.setObscuredByAnotherView(isWebContentObscured);
}
}
use of org.chromium.content.browser.ContentViewCore in project AndroidChromium by JackyAndroid.
the class ShareServiceImpl method activityFromWebContents.
@Nullable
private static Activity activityFromWebContents(@Nullable WebContents webContents) {
if (webContents == null)
return null;
ContentViewCore contentViewCore = ContentViewCore.fromWebContents(webContents);
if (contentViewCore == null)
return null;
WindowAndroid window = contentViewCore.getWindowAndroid();
if (window == null)
return null;
return window.getActivity().get();
}
Aggregations