本文整理汇总了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);
}
示例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());
}
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
}
});
}
示例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);
}
});
}
示例14: setViewClientForTesting
import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
@VisibleForTesting
public void setViewClientForTesting(ContentViewClient client) {
setContentViewClient(client);
}
示例15: getViewClientForTesting
import org.chromium.content.browser.ContentViewClient; //导入依赖的package包/类
@VisibleForTesting
public ContentViewClient getViewClientForTesting() {
return getContentViewClient();
}