use of org.chromium.chrome.browser.IntentHandler.TabOpenType in project AndroidChromium by JackyAndroid.
the class ChromeActivity method createIntentHandlerDelegate.
protected IntentHandlerDelegate createIntentHandlerDelegate() {
return new IntentHandlerDelegate() {
@Override
public void processWebSearchIntent(String query) {
Intent searchIntent = new Intent(Intent.ACTION_WEB_SEARCH);
searchIntent.putExtra(SearchManager.QUERY, query);
startActivity(searchIntent);
}
@Override
public void processUrlViewIntent(String url, String referer, String headers, TabOpenType tabOpenType, String externalAppId, int tabIdToBringToFront, boolean hasUserGesture, Intent intent) {
}
};
}
use of org.chromium.chrome.browser.IntentHandler.TabOpenType in project AndroidChromium by JackyAndroid.
the class SeparateTaskManagedCustomTabActivity method createIntentHandlerDelegate.
@Override
protected IntentHandlerDelegate createIntentHandlerDelegate() {
return new IntentHandlerDelegate() {
@Override
public void processWebSearchIntent(String query) {
}
@Override
public void processUrlViewIntent(String url, String referer, String headers, TabOpenType tabOpenType, String externalAppId, int tabIdToBringToFront, boolean hasUserGesture, Intent intent) {
Tab currentTab = getTabCreator(false).launchUrlFromExternalApp(url, referer, headers, externalAppId, true, intent, mIntentHandlingTimeMs);
// Close all existing tabs from the previous session.
TabModel tabModel = getTabModelSelector().getModel(false);
for (int i = tabModel.getCount() - 1; i >= 0; i--) {
if (tabModel.getTabAt(i).equals(currentTab))
continue;
tabModel.closeTab(tabModel.getTabAt(i), false, false, false);
}
}
};
}
Aggregations