Search in sources :

Example 16 with LoadUrlParams

use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.

the class TabContextMenuItemDelegate method onOpenInNewTab.

@Override
public void onOpenInNewTab(String url, Referrer referrer) {
    RecordUserAction.record("MobileNewTabOpened");
    LoadUrlParams loadUrlParams = new LoadUrlParams(url);
    loadUrlParams.setReferrer(referrer);
    Tab newTab = mTab.getTabModelSelector().openNewTab(loadUrlParams, TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, isIncognito());
    // {@code newTab} is null in document mode. Do not record metrics for document mode.
    if (mTab.getTabUma() != null && newTab != null) {
        mTab.getTabUma().onBackgroundTabOpenedFromContextMenu(newTab);
    }
}
Also used : LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams)

Example 17 with LoadUrlParams

use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.

the class TabContextMenuItemDelegate method onOpenImageInNewTab.

@Override
public void onOpenImageInNewTab(String url, Referrer referrer) {
    boolean useOriginal = isSpdyProxyEnabledForUrl(url);
    LoadUrlParams loadUrlParams = new LoadUrlParams(url);
    loadUrlParams.setVerbatimHeaders(useOriginal ? PAGESPEED_PASSTHROUGH_HEADERS : null);
    loadUrlParams.setReferrer(referrer);
    mTab.getActivity().getTabModelSelector().openNewTab(loadUrlParams, TabLaunchType.FROM_LONGPRESS_BACKGROUND, mTab, isIncognito());
}
Also used : LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams)

Example 18 with LoadUrlParams

use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.

the class TabContextMenuItemDelegate method onOpenImageUrl.

@Override
public void onOpenImageUrl(String url, Referrer referrer) {
    LoadUrlParams loadUrlParams = new LoadUrlParams(url);
    loadUrlParams.setTransitionType(PageTransition.LINK);
    loadUrlParams.setReferrer(referrer);
    mTab.loadUrl(loadUrlParams);
}
Also used : LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams)

Example 19 with LoadUrlParams

use of org.chromium.content_public.browser.LoadUrlParams in project AndroidChromium by JackyAndroid.

the class TabDelegate method createTabWithWebContents.

@Override
public boolean createTabWithWebContents(Tab parent, WebContents webContents, int parentId, TabLaunchType type, String url) {
    if (url == null)
        url = "";
    AsyncTabCreationParams asyncParams = new AsyncTabCreationParams(new LoadUrlParams(url, PageTransition.AUTO_TOPLEVEL), webContents);
    createNewTab(asyncParams, type, parentId);
    return true;
}
Also used : LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams)

Example 20 with LoadUrlParams

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
}
Also used : LoadUrlParams(org.chromium.content_public.browser.LoadUrlParams)

Aggregations

LoadUrlParams (org.chromium.content_public.browser.LoadUrlParams)35 Tab (org.chromium.chrome.browser.tab.Tab)9 Intent (android.content.Intent)6 Referrer (org.chromium.content_public.common.Referrer)5 TabDelegate (org.chromium.chrome.browser.tabmodel.document.TabDelegate)4 PendingIntent (android.app.PendingIntent)3 CustomTabsIntent (android.support.customtabs.CustomTabsIntent)3 Context (android.content.Context)2 CustomTabsSessionToken (android.support.customtabs.CustomTabsSessionToken)2 AlertDialog (android.support.v7.app.AlertDialog)2 View (android.view.View)2 CalledByNative (org.chromium.base.annotations.CalledByNative)2 TabLaunchType (org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType)2 AsyncTabCreationParams (org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams)2 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 SharedPreferences (android.content.SharedPreferences)1 Bitmap (android.graphics.Bitmap)1 Uri (android.net.Uri)1 SparseIntArray (android.util.SparseIntArray)1