Java Code Examples for org.chromium.chrome.browser.ntp.NativePageFactory#createNativePageForURL()

The following examples show how to use org.chromium.chrome.browser.ntp.NativePageFactory#createNativePageForURL() . 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: Tab.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Shows a native page for url if it's a valid chrome-native URL. Otherwise, does nothing.
 * @param url The url of the current navigation.
 * @param forceReload If true, the current native page (if any) will not be reused, even if it
 *                    matches the URL.
 * @return True, if a native page was displayed for url.
 */
boolean maybeShowNativePage(String url, boolean forceReload) {
    // While detached for reparenting we don't have an owning Activity, or TabModelSelector,
    // so we can't create the native page. The native page will be created once reparenting is
    // completed.
    if (mIsDetachedForReparenting) return false;
    NativePage candidateForReuse = forceReload ? null : getNativePage();
    NativePage nativePage = NativePageFactory.createNativePageForURL(url, candidateForReuse,
            this, getTabModelSelector(), getActivity());
    if (nativePage != null) {
        showNativePage(nativePage);
        notifyPageTitleChanged();
        notifyFaviconChanged();
        return true;
    }
    return false;
}
 
Example 2
Source File: Tab.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Shows a native page for url if it's a valid chrome-native URL. Otherwise, does nothing.
 * @param url The url of the current navigation.
 * @param forceReload If true, the current native page (if any) will not be reused, even if it
 *                    matches the URL.
 * @return True, if a native page was displayed for url.
 */
boolean maybeShowNativePage(String url, boolean forceReload) {
    // While detached for reparenting we don't have an owning Activity, or TabModelSelector,
    // so we can't create the native page. The native page will be created once reparenting is
    // completed.
    if (mIsDetached) return false;
    NativePage candidateForReuse = forceReload ? null : getNativePage();
    NativePage nativePage = NativePageFactory.createNativePageForURL(url, candidateForReuse,
            this, getTabModelSelector(), getActivity());
    if (nativePage != null) {
        showNativePage(nativePage);
        notifyPageTitleChanged();
        notifyFaviconChanged();
        return true;
    }
    return false;
}
 
Example 3
Source File: Tab.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Shows a native page for url if it's a valid chrome-native URL. Otherwise, does nothing.
 * @param url The url of the current navigation.
 * @param forceReload If true, the current native page (if any) will not be reused, even if it
 *                    matches the URL.
 * @return True, if a native page was displayed for url.
 */
boolean maybeShowNativePage(String url, boolean forceReload) {
    NativePage candidateForReuse = forceReload ? null : getNativePage();
    NativePage nativePage = NativePageFactory.createNativePageForURL(url, candidateForReuse,
            this, getTabModelSelector(), getActivity());
    if (nativePage != null) {
        showNativePage(nativePage);
        notifyPageTitleChanged();
        notifyFaviconChanged();
        return true;
    }
    return false;
}