org.chromium.ui.base.ViewAndroidDelegate Java Examples

The following examples show how to use org.chromium.ui.base.ViewAndroidDelegate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Tab.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private ContentViewCore createContentViewCore(WebContents webContents) {
    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());
    ChromeActionModeCallback actionModeCallback = new ChromeActionModeCallback(
            mThemedApplicationContext, this, cvc.getActionModeCallbackHelper());
    cvc.setActionModeCallback(actionModeCallback);
    return cvc;
}
 
Example #2
Source File: AutofillPopupBridge.java    From delion with Apache License 2.0 4 votes vote down vote up
@CalledByNative
private static AutofillPopupBridge create(long nativeAutofillPopupViewAndroid,
        WindowAndroid windowAndroid, ViewAndroidDelegate viewAndroidDelegate) {
    return new AutofillPopupBridge(
            nativeAutofillPopupViewAndroid, windowAndroid, viewAndroidDelegate);
}
 
Example #3
Source File: ContentViewCore.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 *
 * @param viewDelegate Delegate to add/remove anchor views.
 * @param internalDispatcher Handles dispatching all hidden or super methods to the
 *                           containerView.
 * @param webContents A WebContents instance to connect to.
 * @param windowAndroid An instance of the WindowAndroid.
 */
// Perform important post-construction set up of the ContentViewCore.
// We do not require the containing view in the constructor to allow embedders to create a
// ContentViewCore without having fully created its containing view. The containing view
// is a vital component of the ContentViewCore, so embedders must exercise caution in what
// they do with the ContentViewCore before calling initialize().
// We supply the nativeWebContents pointer here rather than in the constructor to allow us
// to set the private browsing mode at a later point for the WebView implementation.
// Note that the caller remains the owner of the nativeWebContents and is responsible for
// deleting it after destroying the ContentViewCore.
public void initialize(ViewAndroidDelegate viewDelegate,
        InternalAccessDelegate internalDispatcher, WebContents webContents,
        WindowAndroid windowAndroid) {
    mViewAndroidDelegate = viewDelegate;
    setContainerView(viewDelegate.getContainerView());
    long windowNativePointer = windowAndroid.getNativePointer();
    assert windowNativePointer != 0;

    final float dipScale = windowAndroid.getDisplay().getDipScale();

    mRenderCoordinates.reset();
    mRenderCoordinates.setDeviceScaleFactor(dipScale, windowAndroid.getContext());

    mNativeContentViewCore = nativeInit(webContents, mViewAndroidDelegate, windowNativePointer,
            dipScale, mRetainedJavaScriptObjects);
    mWebContents = nativeGetWebContentsAndroid(mNativeContentViewCore);

    setContainerViewInternals(internalDispatcher);

    initPopupZoomer(mContext);
    mImeAdapter = new ImeAdapter(
            mWebContents, mContainerView, new InputMethodManagerWrapper(mContext));
    mImeAdapter.addEventObserver(this);

    mSelectionPopupController = new SelectionPopupController(
            mContext, windowAndroid, webContents, mContainerView, mRenderCoordinates);
    mSelectionPopupController.setCallback(ActionModeCallbackHelper.EMPTY_CALLBACK);
    mSelectionPopupController.setContainerView(mContainerView);

    mWebContentsObserver = new ContentViewWebContentsObserver(this);

    mShouldRequestUnbufferedDispatch = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
            && ContentFeatureList.isEnabled(ContentFeatureList.REQUEST_UNBUFFERED_DISPATCH);
}
 
Example #4
Source File: ContentViewCore.java    From 365browser with Apache License 2.0 4 votes vote down vote up
private native long nativeInit(WebContents webContents, ViewAndroidDelegate viewAndroidDelegate,
long windowAndroidPtr, float dipScale, HashSet<Object> retainedObjectSet);
 
Example #5
Source File: PasswordGenerationPopupBridge.java    From delion with Apache License 2.0 2 votes vote down vote up
/**
 * A convenience method for the constructor to be invoked from the native counterpart.
 * @param nativePopup The pointer to the native counterpart.
 * @param windowAndroid The browser window.
 * @param containerViewDelegate Interface to acquire and release anchors.
 */
@CalledByNative
private static PasswordGenerationPopupBridge create(long nativePopup,
        WindowAndroid windowAndroid, ViewAndroidDelegate viewAndroidDelegate) {
    return new PasswordGenerationPopupBridge(nativePopup, windowAndroid, viewAndroidDelegate);
}