Java Code Examples for org.chromium.chrome.browser.tabmodel.document.TabDelegate#createNewTab()
The following examples show how to use
org.chromium.chrome.browser.tabmodel.document.TabDelegate#createNewTab() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BookmarkActionBar.java From delion with Apache License 2.0 | 5 votes |
private static void openBookmarksInNewTabs( List<BookmarkId> bookmarks, TabDelegate tabDelegate, BookmarkModel model) { for (BookmarkId id : bookmarks) { tabDelegate.createNewTab(new LoadUrlParams(model.getBookmarkById(id).getUrl()), TabLaunchType.FROM_LONGPRESS_BACKGROUND, null); } }
Example 2
Source File: BookmarkActionBar.java From AndroidChromium with Apache License 2.0 | 5 votes |
private static void openBookmarksInNewTabs( List<BookmarkId> bookmarks, TabDelegate tabDelegate, BookmarkModel model) { for (BookmarkId id : bookmarks) { tabDelegate.createNewTab(new LoadUrlParams(model.getBookmarkById(id).getUrl()), TabLaunchType.FROM_LONGPRESS_BACKGROUND, null); } }
Example 3
Source File: OfflinePageDownloadBridge.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * 'Opens' the offline page identified by the GUID. * This is done by creating a new tab and navigating it to the saved local snapshot. * No automatic redirection is happening based on the connection status. * If the item with specified GUID is not found or can't be opened, nothing happens. * @param guid GUID of the item to open. * @param componentName If specified, targets a specific Activity to open the offline page in. */ @Override public void openItem(String guid, @Nullable ComponentName componentName) { OfflinePageDownloadItem item = getItem(guid); if (item == null) return; LoadUrlParams params = OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion( item.getUrl(), nativeGetOfflineIdByGuid(mNativeOfflinePageDownloadBridge, guid)); AsyncTabCreationParams asyncParams = componentName == null ? new AsyncTabCreationParams(params) : new AsyncTabCreationParams(params, componentName); final TabDelegate tabDelegate = new TabDelegate(false); tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, Tab.INVALID_TAB_ID); }
Example 4
Source File: BookmarkActionBar.java From 365browser with Apache License 2.0 | 5 votes |
private static void openBookmarksInNewTabs( List<BookmarkId> bookmarks, TabDelegate tabDelegate, BookmarkModel model) { for (BookmarkId id : bookmarks) { tabDelegate.createNewTab(new LoadUrlParams(model.getBookmarkById(id).getUrl()), TabLaunchType.FROM_LONGPRESS_BACKGROUND, null); } }
Example 5
Source File: OfflinePageDownloadBridge.java From 365browser with Apache License 2.0 | 5 votes |
/** * 'Opens' the offline page identified by the GUID. * This is done by creating a new tab and navigating it to the saved local snapshot. * No automatic redirection is happening based on the connection status. * If the item with specified GUID is not found or can't be opened, nothing happens. * @param guid GUID of the item to open. * @param componentName If specified, targets a specific Activity to open the offline page in. */ @Override public void openItem(String guid, @Nullable ComponentName componentName) { OfflinePageDownloadItem item = getItem(guid); if (item == null) return; LoadUrlParams params = OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion( item.getUrl(), nativeGetOfflineIdByGuid(mNativeOfflinePageDownloadBridge, guid)); AsyncTabCreationParams asyncParams = componentName == null ? new AsyncTabCreationParams(params) : new AsyncTabCreationParams(params, componentName); final TabDelegate tabDelegate = new TabDelegate(false); tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, Tab.INVALID_TAB_ID); }