Search in sources :

Example 1 with WarmupManager

use of org.chromium.chrome.browser.WarmupManager in project AndroidChromium by JackyAndroid.

the class CustomTabsConnection method preconnectUrls.

private boolean preconnectUrls(List<Bundle> likelyBundles) {
    boolean atLeastOneUrl = false;
    if (likelyBundles == null)
        return false;
    WarmupManager warmupManager = WarmupManager.getInstance();
    Profile profile = Profile.getLastUsedProfile();
    for (Bundle bundle : likelyBundles) {
        Uri uri;
        try {
            uri = IntentUtils.safeGetParcelable(bundle, CustomTabsService.KEY_URL);
        } catch (ClassCastException e) {
            continue;
        }
        String url = checkAndConvertUri(uri);
        if (url != null) {
            warmupManager.maybePreconnectUrlAndSubResources(profile, url);
            atLeastOneUrl = true;
        }
    }
    return atLeastOneUrl;
}
Also used : WarmupManager(org.chromium.chrome.browser.WarmupManager) Bundle(android.os.Bundle) Uri(android.net.Uri) Profile(org.chromium.chrome.browser.profiles.Profile)

Aggregations

Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 WarmupManager (org.chromium.chrome.browser.WarmupManager)1 Profile (org.chromium.chrome.browser.profiles.Profile)1