Java Code Examples for org.chromium.content.browser.ContentView#createContentView()

The following examples show how to use org.chromium.content.browser.ContentView#createContentView() . 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 delion with Apache License 2.0 5 votes vote down vote up
/**
 * Creates and initializes the {@link ContentViewCore}.
 *
 * @param webContents The WebContents object that will be used to build the
 *                    {@link ContentViewCore}.
 */
protected void initContentViewCore(WebContents webContents) {
    ContentViewCore cvc = new ContentViewCore(mThemedApplicationContext);
    ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
    cv.setContentDescription(mThemedApplicationContext.getResources().getString(
            R.string.accessibility_content_view));
    cvc.initialize(cv, cv, webContents, getWindowAndroid());
    setContentViewCore(cvc);
    if (getTabModelSelector() instanceof SingleTabModelSelector) {
        getContentViewCore().setFullscreenRequiredForOrientationLock(false);
    }
}
 
Example 2
Source File: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
/** 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);
    ContentView cv = ContentView.createContentView(mThemedApplicationContext, cvc);
    cv.setContentDescription(mThemedApplicationContext.getResources().getString(
            R.string.accessibility_content_view));
    cvc.initialize(cv, cv, webContents, getWindowAndroid());
    swapContentViewCore(cvc, false, didStartLoad, didFinishLoad);
}
 
Example 3
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 4
Source File: Tab.java    From 365browser 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(new TabViewAndroidDelegate(this, cv), cv, webContents, getWindowAndroid());
    ChromeActionModeCallback actionModeCallback = new ChromeActionModeCallback(
            mThemedApplicationContext, this, cvc.getActionModeCallbackHelper());
    cvc.setActionModeCallback(actionModeCallback);
    return cvc;
}