当前位置: 首页>>代码示例>>Java>>正文


Java ContentViewClient类代码示例

本文整理汇总了Java中org.chromium.content.browser.ContentViewClient的典型用法代码示例。如果您正苦于以下问题:Java ContentViewClient类的具体用法?Java ContentViewClient怎么用?Java ContentViewClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContentViewClient类属于org.chromium.content.browser包,在下文中一共展示了ContentViewClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: adjustPhysicalBackingSize

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * Adjusts the physical backing size of a given ContentViewCore. This method will first check
 * if the ContentViewCore's client wants to override the size and, if so, it will use the
 * values provided by the {@link ContentViewClient#getDesiredWidthMeasureSpec()} and
 * {@link ContentViewClient#getDesiredHeightMeasureSpec()} methods. If no value is provided
 * in one of these methods, the values from the |width| and |height| arguments will be
 * used instead.
 *
 * @param contentViewCore The {@link ContentViewCore} to resize.
 * @param width The default width.
 * @param height The default height.
 */
private void adjustPhysicalBackingSize(ContentViewCore contentViewCore, int width, int height) {
    ContentViewClient client = contentViewCore.getContentViewClient();

    int desiredWidthMeasureSpec = client.getDesiredWidthMeasureSpec();
    if (MeasureSpec.getMode(desiredWidthMeasureSpec) != MeasureSpec.UNSPECIFIED) {
        width = MeasureSpec.getSize(desiredWidthMeasureSpec);
    }

    int desiredHeightMeasureSpec = client.getDesiredHeightMeasureSpec();
    if (MeasureSpec.getMode(desiredHeightMeasureSpec) != MeasureSpec.UNSPECIFIED) {
        height = MeasureSpec.getSize(desiredHeightMeasureSpec);
    }

    contentViewCore.onPhysicalBackingSizeChanged(width, height);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:CompositorViewHolder.java

示例2: setContentViewClient

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * @param client The {@link ContentViewClient} to be bound to any current or new
 *               {@link ContentViewCore}s associated with this {@link Tab}.
 */
private void setContentViewClient(ContentViewClient client) {
    if (mContentViewClient == client) return;

    ContentViewClient oldClient = mContentViewClient;
    mContentViewClient = client;

    if (mContentViewCore == null) return;

    if (mContentViewClient != null) {
        mContentViewCore.setContentViewClient(mContentViewClient);
    } else if (oldClient != null) {
        // We can't set a null client, but we should clear references to the last one.
        mContentViewCore.setContentViewClient(new ContentViewClient());
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:Tab.java

示例3: createDistillerContentViewCore

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
private ContentViewCore createDistillerContentViewCore(
        Context context, WindowAndroid windowAndroid) {
    boolean isHostTabIncognito =
            mReaderModeHost.getTab().getContentViewCore().getWebContents().isIncognito();
    ContentViewCore cvc = new ContentViewCore(context);
    ContentView cv = new ContentView(context, cvc);
    cvc.initialize(cv, cv, WebContentsFactory.createWebContents(isHostTabIncognito, true),
            windowAndroid);
    cvc.setContentViewClient(new ContentViewClient() {
        @Override
        public void onOffsetsForFullscreenChanged(float topControlsOffsetYPix,
                float contentOffsetYPix, float overdrawBottomHeightPix) {
            super.onOffsetsForFullscreenChanged(topControlsOffsetYPix, contentOffsetYPix,
                    overdrawBottomHeightPix);
            mTopControlsOffsetYPix = topControlsOffsetYPix;
            mContentOffsetYPix = contentOffsetYPix;
            mOverdrawBottomHeightPix = overdrawBottomHeightPix;
        }
    });
    return cvc;
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:22,代码来源:ReaderModePanel.java

示例4: setContentViewClient

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * @param client The {@link ContentViewClient} to be bound to any current or new
 *               {@link ContentViewCore}s associated with this {@link Tab}.
 */
protected void setContentViewClient(ContentViewClient client) {
    if (mContentViewClient == client) return;

    ContentViewClient oldClient = mContentViewClient;
    mContentViewClient = client;

    if (mContentViewCore == null) return;

    if (mContentViewClient != null) {
        mContentViewCore.setContentViewClient(mContentViewClient);
    } else if (oldClient != null) {
        // We can't set a null client, but we should clear references to the last one.
        mContentViewCore.setContentViewClient(new ContentViewClient());
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:20,代码来源:Tab.java

示例5: setContentViewClient

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * @param client The {@link ContentViewClient} to be bound to any current or new
 *               {@link ContentViewCore}s associated with this {@link TabBase}.
 */
protected void setContentViewClient(ContentViewClient client) {
    if (mContentViewClient == client) return;

    ContentViewClient oldClient = mContentViewClient;
    mContentViewClient = client;

    if (mContentViewCore == null) return;

    if (mContentViewClient != null) {
        mContentViewCore.setContentViewClient(mContentViewClient);
    } else if (oldClient != null) {
        // We can't set a null client, but we should clear references to the last one.
        mContentViewCore.setContentViewClient(new ContentViewClient());
    }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:20,代码来源:TabBase.java

示例6: createAndInitializeContentViewCore

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
private static ContentViewCore createAndInitializeContentViewCore(ViewGroup containerView,
        InternalAccessDelegate internalDispatcher, int nativeWebContents,
        GestureStateListener gestureStateListener,
        ContentViewClient contentViewClient,
        ContentViewCore.ZoomControlsDelegate zoomControlsDelegate) {
    Context context = containerView.getContext();
    ContentViewCore contentViewCore = new ContentViewCore(context);
    contentViewCore.initialize(containerView, internalDispatcher, nativeWebContents,
            context instanceof Activity ?
                    new ActivityWindowAndroid((Activity) context) :
                    new WindowAndroid(context.getApplicationContext()));
    contentViewCore.addGestureStateListener(gestureStateListener);
    contentViewCore.setContentViewClient(contentViewClient);
    contentViewCore.setZoomControlsDelegate(zoomControlsDelegate);
    return contentViewCore;
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:17,代码来源:AwContents.java

示例7: finishInitialization

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
protected void finishInitialization(Bundle savedInstanceState) {
    String shellUrl;
    if (savedInstanceState != null
            && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
        shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
    }
    Shell activeShell = getActiveShell();
    if (activeShell == null) {
        ContentMain.start();
    }
    getActiveContentView().setContentViewClient(new ContentViewClient() {
        @Override
        public ContentVideoViewClient getContentVideoViewClient() {
            return new ActivityContentVideoViewClient(CordovaChromiumActivity.this);
        }
    });
}
 
开发者ID:R4md4c,项目名称:cordova-android-chromium,代码行数:18,代码来源:CordovaChromiumActivity.java

示例8: createAndInitializeContentViewCore

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
private static ContentViewCore createAndInitializeContentViewCore(ViewGroup containerView,
        InternalAccessDelegate internalDispatcher, int nativeWebContents,
        ContentViewCore.GestureStateListener pinchGestureStateListener,
        ContentViewClient contentViewClient,
        ContentViewCore.ZoomControlsDelegate zoomControlsDelegate) {
  Context context = containerView.getContext();
  ContentViewCore contentViewCore = new ContentViewCore(context);
  // Note INPUT_EVENTS_DELIVERED_IMMEDIATELY is passed to avoid triggering vsync in the
  // compositor, not because input events are delivered immediately.
  contentViewCore.initialize(containerView, internalDispatcher, nativeWebContents,
          context instanceof Activity ?
                  new ActivityWindowAndroid((Activity) context) : new WindowAndroid(context),
            ContentViewCore.INPUT_EVENTS_DELIVERED_IMMEDIATELY);
  contentViewCore.setGestureStateListener(pinchGestureStateListener);
  contentViewCore.setContentViewClient(contentViewClient);
  contentViewCore.setZoomControlsDelegate(zoomControlsDelegate);
  return contentViewCore;
}
 
开发者ID:R4md4c,项目名称:cordova-android-chromium,代码行数:19,代码来源:AwContents.java

示例9: setContentViewClient

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * Set a ContentViewClient for this panel to use (will be reused for each new ContentViewCore).
 * @param viewClient The ContentViewClient to use.
 */
public void setContentViewClient(ContentViewClient viewClient) {
    mContentViewClient = viewClient;
    if (mContentViewCore != null) {
        mContentViewCore.setContentViewClient(mContentViewClient);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:OverlayPanelContent.java

示例10: createNewOverlayPanelContentInternal

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * Add any other objects that depend on the OverlayPanelContent having already been created.
 */
private OverlayPanelContent createNewOverlayPanelContentInternal() {
    OverlayPanelContent content = mContentFactory.createNewOverlayPanelContent();

    content.setContentViewClient(new ContentViewClient() {
        @Override
        public int getDesiredWidthMeasureSpec() {
            if (isFullWidthSizePanel()) {
                return super.getDesiredWidthMeasureSpec();
            } else {
                return MeasureSpec.makeMeasureSpec(
                        getContentViewWidthPx(),
                        MeasureSpec.EXACTLY);
            }
        }

        @Override
        public int getDesiredHeightMeasureSpec() {
            if (isFullWidthSizePanel()) {
                return super.getDesiredHeightMeasureSpec();
            } else {
                return MeasureSpec.makeMeasureSpec(
                        getContentViewHeightPx(),
                        MeasureSpec.EXACTLY);
            }
        }
    });
    return content;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:32,代码来源:OverlayPanel.java

示例11: enterDistilledMode

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
private void enterDistilledMode() {
    if (!isReaderModeCurrentlyAllowed()) return;

    RecordUserAction.record("DomDistiller_DistilledPageOpened");
    mSlidingT = -1.0f;
    requestUpdate();

    mDistilledContentViewCore.getWebContents().updateTopControlsState(true, false, false);

    mReaderModeHost.getTab().detachOverlayContentViewCore(mDistilledContentViewCore);
    mDistilledContentObserver.destroy();
    mDistilledContentObserver = null;

    mOriginalWebContent = mReaderModeHost.getTab().getWebContents();

    mDistilledContentViewCore.setContentViewClient(new ContentViewClient());
    mReaderModeHost.getTab().swapContentViewCore(mDistilledContentViewCore, false,
            mDidStartLoad, mDidFinishLoad);
    mDistilledContentViewCore.getContentViewClient().onOffsetsForFullscreenChanged(
            mTopControlsOffsetYPix, mContentOffsetYPix, mOverdrawBottomHeightPix);

    mDistilledContentViewCore = null;
    destroyDistilledContentViewCore();

    if (mLayoutDelegate != null) {
        mLayoutDelegate.setLayoutTabBrightness(1.0f);
        mLayoutDelegate.setLayoutTabY(0.0f);
    }

    updateBottomButtonBar();
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:32,代码来源:ReaderModePanel.java

示例12: finishInitialization

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
private void finishInitialization(Bundle savedInstanceState) {
    String shellUrl = ShellManager.DEFAULT_SHELL_URL;
    if (savedInstanceState != null
            && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
        shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
    }
    mShellManager.launchShell(shellUrl);
    getActiveContentView().setContentViewClient(new ContentViewClient() {
        @Override
        public ContentVideoViewClient getContentVideoViewClient() {
            return new ActivityContentVideoViewClient(ContentShellActivity.this);
        }
    });
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:15,代码来源:ContentShellActivity.java

示例13: createTab

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
/**
 * Creates a {@link TestShellTab} with a URL specified by {@code url}.
 *
 * @param url The URL the new {@link TestShellTab} should start with.
 */
public void createTab(String url) {
    mTabManager.createTab(url);
    getActiveContentView().setContentViewClient(new ContentViewClient() {
        @Override
        public ContentVideoViewClient getContentVideoViewClient() {
            return new ActivityContentVideoViewClient(ChromiumTestShellActivity.this);
        }
    });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:15,代码来源:ChromiumTestShellActivity.java

示例14: setViewClientForTesting

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
@VisibleForTesting
public void setViewClientForTesting(ContentViewClient client) {
    setContentViewClient(client);
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:5,代码来源:ChromeTab.java

示例15: getViewClientForTesting

import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
@VisibleForTesting
public ContentViewClient getViewClientForTesting() {
    return getContentViewClient();
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:5,代码来源:ChromeTab.java


注:本文中的org.chromium.content.browser.ContentViewClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。