本文整理汇总了Java中org.chromium.content.browser.ContentView类的典型用法代码示例。如果您正苦于以下问题:Java ContentView类的具体用法?Java ContentView怎么用?Java ContentView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContentView类属于org.chromium.content.browser包,在下文中一共展示了ContentView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDistillerContentViewCore
import org.chromium.content.browser.ContentView; //导入依赖的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;
}
示例2: createShell
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@SuppressWarnings("unused")
@CalledByNative
private Object createShell() {
LayoutInflater inflater =
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
shellView.setWindow(mWindow);
if (mActiveShell != null) closeShell(mActiveShell);
shellView.setContentViewRenderView(mContentViewRenderView);
addView(shellView, new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
mActiveShell = shellView;
ContentView contentView = mActiveShell.getContentView();
if (contentView != null) {
mContentViewRenderView.setCurrentContentView(contentView);
contentView.onShow();
}
return shellView;
}
示例3: loadUrlWithSanitization
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
/**
* Navigates this Tab's {@link ContentView} to a sanitized version of {@code url}.
* @param url The potentially unsanitized URL to navigate to.
* @param postData Optional data to be sent via POST.
*/
public void loadUrlWithSanitization(String url, byte[] postData) {
if (url == null) return;
// Sanitize the URL.
url = nativeFixupUrl(mNativeTestShellTab, url);
// Invalid URLs will just return empty.
if (TextUtils.isEmpty(url)) return;
ContentView contentView = getContentView();
if (TextUtils.equals(url, contentView.getUrl())) {
contentView.getContentViewCore().reload(true);
} else {
if (postData == null) {
contentView.loadUrl(new LoadUrlParams(url));
} else {
contentView.loadUrl(LoadUrlParams.createLoadHttpPostParams(url, postData));
}
}
}
示例4: createShell
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@SuppressWarnings("unused")
@CalledByNative
protected Object createShell() {
LayoutInflater inflater =
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
shellView.setWindow(mWindow);
if (mActiveShell != null) closeShell(mActiveShell);
shellView.setContentViewRenderView(mContentViewRenderView);
addView(shellView, new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
mActiveShell = shellView;
ContentView contentView = mActiveShell.getContentView();
if (contentView != null) {
mContentViewRenderView.setCurrentContentView(contentView);
contentView.onShow();
}
return shellView;
}
示例5: createShell
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@Override
protected Object createShell() {
LayoutInflater inflater =
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
CordovaWebView shellView = (CordovaWebView) inflater.inflate(R.layout.cordova_shell_view, null);
shellView.setWindow(mWindow);
//shellView.setup();
if (mActiveShell != null) closeShell(mActiveShell);
shellView.setContentViewRenderView(mContentViewRenderView);
addView(shellView, new FrameLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
mActiveShell = shellView;
ContentView contentView = mActiveShell.getContentView();
if (contentView != null) {
mContentViewRenderView.setCurrentContentView(contentView);
contentView.onShow();
}
//shellView.setup();
return shellView;
}
示例6: createContentViewCore
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
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;
}
示例7: initContentViewCore
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
/**
* 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(mContext);
ContentView cv = new ContentView(mContext, cvc);
cv.setContentDescription(mContext.getResources().getString(
R.string.accessibility_content_view));
cvc.initialize(cv, cv, webContents, getWindowAndroid());
setContentViewCore(cvc);
}
示例8: swapWebContents
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
/** 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(mContext);
ContentView cv = new ContentView(mContext, cvc);
cv.setContentDescription(mContext.getResources().getString(
R.string.accessibility_content_view));
cvc.initialize(cv, cv, webContents, getWindowAndroid());
swapContentViewCore(cvc, false, didStartLoad, didFinishLoad);
}
示例9: adjustPhysicalBackingSize
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
/**
* Adjusts the physical backing size of a given ContentViewCore. This method checks
* the associated container view to see if the size needs to be overriden, such as when used for
* {@link OverlayPanel}.
* @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) {
ContentView contentView = (ContentView) contentViewCore.getContainerView();
if (contentView == mOverlayContentView) {
width = MeasureSpec.getSize(mOverlayContentWidthMeasureSpec);
height = MeasureSpec.getSize(mOverlayContentHeightMeasureSpec);
}
mCompositorView.onPhysicalBackingSizeChanged(
contentViewCore.getWebContents(), width, height);
}
示例10: createContentViewCore
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
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;
}
示例11: closeShell
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@SuppressWarnings("unused")
@CalledByNative
private void closeShell(Shell shellView) {
if (shellView == mActiveShell) mActiveShell = null;
ContentView contentView = shellView.getContentView();
if (contentView != null) contentView.onHide();
shellView.setContentViewRenderView(null);
shellView.setWindow(null);
removeView(shellView);
}
示例12: onPause
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@Override
protected void onPause() {
ContentView view = getActiveContentView();
if (view != null) view.onActivityPause();
super.onPause();
unregisterReceiver(mReceiver);
}
示例13: onResume
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
ContentView view = getActiveContentView();
if (view != null) view.onActivityResume();
IntentFilter intentFilter = new IntentFilter(ACTION_START_TRACE);
intentFilter.addAction(ACTION_STOP_TRACE);
mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String extra = intent.getStringExtra("file");
if (ACTION_START_TRACE.equals(action)) {
if (extra.isEmpty()) {
Log.e(TAG, "Can not start tracing without specifing saving location");
} else {
TracingIntentHandler.beginTracing(extra);
Log.i(TAG, "start tracing");
}
} else if (ACTION_STOP_TRACE.equals(action)) {
Log.i(TAG, "stop tracing");
TracingIntentHandler.endTracing();
}
}
};
registerReceiver(mReceiver, intentFilter);
}
示例14: initFromNativeTabContents
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
/**
* Initializes the ContentView based on the native tab contents pointer passed in.
* @param nativeTabContents The pointer to the native tab contents object.
*/
@SuppressWarnings("unused")
@CalledByNative
private void initFromNativeTabContents(int nativeTabContents) {
mContentView = ContentView.newInstance(getContext(), nativeTabContents, mWindow);
if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.getUrl());
((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentView,
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
mContentView.requestFocus();
mContentViewRenderView.setCurrentContentView(mContentView);
}
示例15: onStop
import org.chromium.content.browser.ContentView; //导入依赖的package包/类
@Override
protected void onStop() {
super.onStop();
ContentView view = getActiveContentView();
if (view != null) view.onHide();
}