当前位置: 首页>>代码示例>>Java>>正文


Java ContentSetting.ALLOW属性代码示例

本文整理汇总了Java中org.chromium.chrome.browser.preferences.website.ContentSetting.ALLOW属性的典型用法代码示例。如果您正苦于以下问题:Java ContentSetting.ALLOW属性的具体用法?Java ContentSetting.ALLOW怎么用?Java ContentSetting.ALLOW使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.chromium.chrome.browser.preferences.website.ContentSetting的用法示例。


在下文中一共展示了ContentSetting.ALLOW属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: locationEnabled

private boolean locationEnabled(TemplateUrl templateUrl) {
    String url = getSearchEngineUrl(templateUrl);
    if (url.isEmpty()) return false;

    GeolocationInfo locationSettings = new GeolocationInfo(url, null, false);
    ContentSetting locationPermission = locationSettings.getContentSetting();
    if (locationPermission == ContentSetting.ASK) {
        // Handle the case where the geoHeader being sent when no permission has been specified.
        if (ChromeFeatureList.isEnabled(ChromeFeatureList.CONSISTENT_OMNIBOX_GEOLOCATION)) {
            if (WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(url, false)) {
                return WebsitePreferenceBridge.getDSEGeolocationSetting();
            }
        } else if (GeolocationHeader.isGeoHeaderEnabledForUrl(url, false)) {
            return true;
        }
    }

    return locationPermission == ContentSetting.ALLOW;
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:19,代码来源:SearchEngineAdapter.java

示例2: locationEnabled

private boolean locationEnabled(int position, boolean checkGeoHeader) {
    if (position == -1) return false;

    String url = TemplateUrlService.getInstance().getSearchEngineUrlFromTemplateUrl(
            toIndex(position));
    GeolocationInfo locationSettings = new GeolocationInfo(url, null, false);
    ContentSetting locationPermission = locationSettings.getContentSetting();
    // Handle the case where the geoHeader being sent when no permission has been specified.
    if (locationPermission == ContentSetting.ASK && checkGeoHeader) {
        return GeolocationHeader.isGeoHeaderEnabledForUrl(mContext, url, false);
    }
    return locationPermission == ContentSetting.ALLOW;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:13,代码来源:SearchEngineAdapter.java

示例3: locationEnabled

private boolean locationEnabled(int position, boolean checkGeoHeader) {
    if (position == -1) return false;

    String url = TemplateUrlService.getInstance().getSearchEngineUrlFromTemplateUrl(
            toIndex(position));
    GeolocationInfo locationSettings = new GeolocationInfo(url, null, false);
    ContentSetting locationPermission = locationSettings.getContentSetting();
    // Handle the case where the geoHeader being sent when no permission has been specified.
    if (locationPermission == ContentSetting.ASK && checkGeoHeader) {
        return PrefServiceBridge.isGeoHeaderEnabledForUrl(mContext, url, false);
    }
    return locationPermission == ContentSetting.ALLOW;
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:13,代码来源:SearchEngineAdapter.java

示例4: statusTextForDSEPermission

/**
 * Update the permission string for the Default Search Engine.
 */
private String statusTextForDSEPermission(PageInfoPermissionEntry permission) {
    if (permission.setting == ContentSetting.ALLOW) {
        return mContext.getString(R.string.page_info_dse_permission_allowed);
    }

    return mContext.getString(R.string.page_info_dse_permission_blocked);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:10,代码来源:PageInfoPopup.java


注:本文中的org.chromium.chrome.browser.preferences.website.ContentSetting.ALLOW属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。