use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class TabContextMenuItemDelegate method onOpenInOtherWindow.
@Override
public void onOpenInOtherWindow(String url, Referrer referrer) {
TabDelegate tabDelegate = new TabDelegate(mTab.isIncognito());
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
loadUrlParams.setReferrer(referrer);
tabDelegate.createTabInOtherWindow(loadUrlParams, mTab.getActivity(), mTab.getParentId());
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class ToolbarManager method openHomepage.
@Override
public void openHomepage() {
RecordUserAction.record("Home");
Tab currentTab = mToolbarModel.getTab();
if (currentTab == null)
return;
Context context = mToolbar.getContext();
String homePageUrl = HomepageManager.getHomepageUri(context);
if (TextUtils.isEmpty(homePageUrl)) {
homePageUrl = UrlConstants.NTP_URL;
}
currentTab.loadUrl(new LoadUrlParams(homePageUrl, PageTransition.HOME_PAGE));
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class FullScreenActivity method preInflationStartup.
@Override
public void preInflationStartup() {
super.preInflationStartup();
setTabCreators(createTabDelegate(false), createTabDelegate(true));
setTabModelSelector(new SingleTabModelSelector(this, false, false) {
@Override
public Tab openNewTab(LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent, boolean incognito) {
getTabCreator(incognito).createNewTab(loadUrlParams, type, parent);
return null;
}
});
}
use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.
the class WebApkActivity method onNewIntent.
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// We could bring a WebAPK hosted WebappActivity to foreground and navigate it to a
// different URL. For example, WebAPK "foo" is launched and navigates to
// "www.foo.com/foo". In Chrome, user clicks a link "www.foo.com/bar" in Google search
// results. After clicking the link, WebAPK "foo" is brought to foreground, and
// loads the page of "www.foo.com/bar" at the same time.
// The extra {@link ShortcutHelper.EXTRA_URL} provides the URL that the WebAPK will
// navigate to.
String overrideUrl = intent.getStringExtra(ShortcutHelper.EXTRA_URL);
if (overrideUrl != null && isInitialized() && !overrideUrl.equals(getActivityTab().getUrl())) {
getActivityTab().loadUrl(new LoadUrlParams(overrideUrl, PageTransition.AUTO_TOPLEVEL));
}
}
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