當前位置: 首頁>>代碼示例>>Java>>正文


Java ChromeWebApkHost.isEnabled方法代碼示例

本文整理匯總了Java中org.chromium.chrome.browser.webapps.ChromeWebApkHost.isEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java ChromeWebApkHost.isEnabled方法的具體用法?Java ChromeWebApkHost.isEnabled怎麽用?Java ChromeWebApkHost.isEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.chromium.chrome.browser.webapps.ChromeWebApkHost的用法示例。


在下文中一共展示了ChromeWebApkHost.isEnabled方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: queryWebApkPackage

import org.chromium.chrome.browser.webapps.ChromeWebApkHost; //導入方法依賴的package包/類
/**
 * Returns the package for the WebAPK which should handle the URL.
 *
 * @param url The url to check.
 * @return Package name of the WebAPK which should handle the URL. Returns empty string if the
 *         URL should not be handled by a WebAPK.
 */
@CalledByNative
private String queryWebApkPackage(String url) {
    if (!ChromeWebApkHost.isEnabled()) return "";

    String webApkPackage =
            WebApkValidator.queryWebApkPackage(mAppContext, url);
    return webApkPackage == null ? "" : webApkPackage;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:16,代碼來源:NotificationPlatformBridge.java

示例2: queryWebApkPackage

import org.chromium.chrome.browser.webapps.ChromeWebApkHost; //導入方法依賴的package包/類
/**
 * Returns the package for the WebAPK which should handle the URL.
 *
 * @param url The url to check.
 * @return Package name of the WebAPK which should handle the URL. Returns empty string if the
 *         URL should not be handled by a WebAPK.
 */
@CalledByNative
private String queryWebApkPackage(String url) {
    if (!ChromeWebApkHost.isEnabled()) return "";

    String webApkPackage =
            WebApkValidator.queryWebApkPackage(ContextUtils.getApplicationContext(), url);
    return webApkPackage == null ? "" : webApkPackage;
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:16,代碼來源:NotificationPlatformBridge.java

示例3: dispatchNotificationEvent

import org.chromium.chrome.browser.webapps.ChromeWebApkHost; //導入方法依賴的package包/類
/**
 * Invoked by the NotificationService when a Notification intent has been received. There may
 * not be an active instance of the NotificationPlatformBridge at this time, so inform the
 * native side through a static method, initializing both ends if needed.
 *
 * @param intent The intent as received by the Notification service.
 * @return Whether the event could be handled by the native Notification bridge.
 */
public static boolean dispatchNotificationEvent(Intent intent) {
    if (sInstance == null) {
        nativeInitializeNotificationPlatformBridge();
        if (sInstance == null) {
            Log.e(TAG, "Unable to initialize the native NotificationPlatformBridge.");
            return false;
        }
    }

    String notificationId = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_ID);

    String origin = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN);
    String profileId =
            intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID);
    boolean incognito = intent.getBooleanExtra(
            NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO, false);
    String tag = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_TAG);

    Log.i(TAG, "Dispatching notification event to native: " + notificationId);

    if (NotificationConstants.ACTION_CLICK_NOTIFICATION.equals(intent.getAction())) {
        String webApkPackage = "";
        if (ChromeWebApkHost.isEnabled()) {
            webApkPackage = intent.getStringExtra(
                NotificationConstants.EXTRA_NOTIFICATION_INFO_WEBAPK_PACKAGE);
            if (webApkPackage == null) {
                webApkPackage = "";
            }
        }
        int actionIndex = intent.getIntExtra(
                NotificationConstants.EXTRA_NOTIFICATION_INFO_ACTION_INDEX, -1);
        sInstance.onNotificationClicked(notificationId, origin, profileId, incognito, tag,
                webApkPackage, actionIndex, getNotificationReply(intent));
        return true;
    } else if (NotificationConstants.ACTION_CLOSE_NOTIFICATION.equals(intent.getAction())) {
        // Notification deleteIntent is executed only "when the notification is explicitly
        // dismissed by the user, either with the 'Clear All' button or by swiping it away
        // individually" (though a third-party NotificationListenerService may also trigger it).
        sInstance.onNotificationClosed(
                notificationId, origin, profileId, incognito, tag, true /* byUser */);
        return true;
    }

    Log.e(TAG, "Unrecognized Notification action: " + intent.getAction());
    return false;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:55,代碼來源:NotificationPlatformBridge.java

示例4: queryWebApkPackage

import org.chromium.chrome.browser.webapps.ChromeWebApkHost; //導入方法依賴的package包/類
/**
 * Returns the package name of the WebAPK if WebAPKs are enabled and there is an installed
 * WebAPK which can handle {@link url}. Returns null otherwise.
 */
@CalledByNative
private static String queryWebApkPackage(String url) {
    if (!ChromeWebApkHost.isEnabled()) return null;
    return WebApkValidator.queryWebApkPackage(ContextUtils.getApplicationContext(), url);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:10,代碼來源:ShortcutHelper.java

示例5: dispatchNotificationEvent

import org.chromium.chrome.browser.webapps.ChromeWebApkHost; //導入方法依賴的package包/類
/**
 * Invoked by the NotificationService when a Notification intent has been received. There may
 * not be an active instance of the NotificationPlatformBridge at this time, so inform the
 * native side through a static method, initializing both ends if needed.
 *
 * @param intent The intent as received by the Notification service.
 * @return Whether the event could be handled by the native Notification bridge.
 */
static boolean dispatchNotificationEvent(Intent intent) {
    if (sInstance == null) {
        nativeInitializeNotificationPlatformBridge();
        if (sInstance == null) {
            Log.e(TAG, "Unable to initialize the native NotificationPlatformBridge.");
            return false;
        }
    }

    String notificationId = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_ID);

    String origin = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_ORIGIN);
    String profileId =
            intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_ID);
    boolean incognito = intent.getBooleanExtra(
            NotificationConstants.EXTRA_NOTIFICATION_INFO_PROFILE_INCOGNITO, false);
    String tag = intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_INFO_TAG);

    Log.i(TAG, "Dispatching notification event to native: " + notificationId);

    if (NotificationConstants.ACTION_CLICK_NOTIFICATION.equals(intent.getAction())) {
        String webApkPackage = "";
        if (ChromeWebApkHost.isEnabled()) {
            webApkPackage = intent.getStringExtra(
                NotificationConstants.EXTRA_NOTIFICATION_INFO_WEBAPK_PACKAGE);
            if (webApkPackage == null) {
                webApkPackage = "";
            }
        }
        int actionIndex = intent.getIntExtra(
                NotificationConstants.EXTRA_NOTIFICATION_INFO_ACTION_INDEX, -1);
        sInstance.onNotificationClicked(notificationId, origin, profileId, incognito, tag,
                webApkPackage, actionIndex, getNotificationReply(intent));
        return true;
    } else if (NotificationConstants.ACTION_CLOSE_NOTIFICATION.equals(intent.getAction())) {
        // Notification deleteIntent is executed only "when the notification is explicitly
        // dismissed by the user, either with the 'Clear All' button or by swiping it away
        // individually" (though a third-party NotificationListenerService may also trigger it).
        sInstance.onNotificationClosed(
                notificationId, origin, profileId, incognito, tag, true /* byUser */);
        return true;
    }

    Log.e(TAG, "Unrecognized Notification action: " + intent.getAction());
    return false;
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:55,代碼來源:NotificationPlatformBridge.java


注:本文中的org.chromium.chrome.browser.webapps.ChromeWebApkHost.isEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。