use of org.mozilla.rocket.tabs.Session in project Rocket by mozilla-tw.
the class PrivateWebContextMenu method openInNewTab.
private static void openInNewTab(final TabView source, final Dialog dialog, final String url) {
final SessionManager session = TabsSessionProvider.getOrThrow(dialog.getOwnerActivity());
final List<Session> tabs = session.getTabs();
String parentId = null;
// Try to find parent tab for new tab
for (final Session tab : tabs) {
if (tab.getEngineSession().getTabView() == source) {
parentId = tab.getId();
break;
}
}
Bundle args = TabUtil.argument(parentId, false, false);
args.putInt(BrowserFragment.EXTRA_NEW_TAB_SRC, BrowserFragment.SRC_CONTEXT_MENU);
session.addTab(url, args);
TelemetryWrapper.addNewTabFromContextMenu();
}
use of org.mozilla.rocket.tabs.Session in project Rocket by mozilla-tw.
the class WebContextMenu method openInNewTab.
private static void openInNewTab(final TabView source, final Dialog dialog, final String url) {
final SessionManager session = TabsSessionProvider.getOrThrow(dialog.getOwnerActivity());
final List<Session> tabs = session.getTabs();
String parentId = null;
// Try to find parent tab for new tab
for (final Session tab : tabs) {
if (tab.getEngineSession().getTabView() == source) {
parentId = tab.getId();
break;
}
}
Bundle args = TabUtil.argument(parentId, false, false);
args.putInt(BrowserFragment.EXTRA_NEW_TAB_SRC, BrowserFragment.SRC_CONTEXT_MENU);
session.addTab(url, args);
TelemetryWrapper.addNewTabFromContextMenu();
}
Aggregations