use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class TabContextMenuItemDelegate method onOpenInNewTab.
@Override
public void onOpenInNewTab(String url, Referrer referrer) {
RecordUserAction.record("MobileNewTabOpened");
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
loadUrlParams.setReferrer(referrer);
Tab newTab = mTab.getTabModelSelector().openNewTab(loadUrlParams, TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, isIncognito());
// {@code newTab} is null in document mode. Do not record metrics for document mode.
if (mTab.getTabUma() != null && newTab != null) {
mTab.getTabUma().onBackgroundTabOpenedFromContextMenu(newTab);
}
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class TabContextMenuItemDelegate method onOpenImageInNewTab.
@Override
public void onOpenImageInNewTab(String url, Referrer referrer) {
boolean useOriginal = isSpdyProxyEnabledForUrl(url);
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
loadUrlParams.setVerbatimHeaders(useOriginal ? PAGESPEED_PASSTHROUGH_HEADERS : null);
loadUrlParams.setReferrer(referrer);
mTab.getActivity().getTabModelSelector().openNewTab(loadUrlParams, TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, isIncognito());
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class TabContextMenuItemDelegate method onOpenImageUrl.
@Override
public void onOpenImageUrl(String url, Referrer referrer) {
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
loadUrlParams.setTransitionType(PageTransition.LINK);
loadUrlParams.setReferrer(referrer);
mTab.loadUrl(loadUrlParams);
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class TabDelegate method createTabWithWebContents.
@Override
public boolean createTabWithWebContents(Tab parent, WebContents webContents, int parentId, TabLaunchType type, String url) {
if (url == null)
url = "";
AsyncTabCreationParams asyncParams = new AsyncTabCreationParams(new LoadUrlParams(url, PageTransition.AUTO_TOPLEVEL), webContents);
createNewTab(asyncParams, type, parentId);
return true;
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class WebappActivity method initializeUI.
private void initializeUI(Bundle savedInstanceState) {
// We do not load URL when restoring from saved instance states.
if (savedInstanceState == null && mWebappInfo.isInitialized()) {
if (TextUtils.isEmpty(getActivityTab().getUrl())) {
getActivityTab().loadUrl(new LoadUrlParams(mWebappInfo.uri().toString(), PageTransition.AUTO_TOPLEVEL));
}
} else {
if (NetworkChangeNotifier.isOnline())
getActivityTab().reloadIgnoringCache();
}
getActivityTab().addObserver(createTabObserver());
getActivityTab().getTabWebContentsDelegateAndroid().setDisplayMode(WebDisplayMode.Standalone);
// TODO(dominickn): send the web app into fullscreen if mDisplayMode is
// WebDisplayMode.Fullscreen. See crbug.com/581522
}
Aggregations