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


Java InfoBarIdentifier类代码示例

本文整理汇总了Java中org.chromium.chrome.browser.infobar.InfoBarIdentifier的典型用法代码示例。如果您正苦于以下问题:Java InfoBarIdentifier类的具体用法?Java InfoBarIdentifier怎么用?Java InfoBarIdentifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: showCallbackNonExistentError

import org.chromium.chrome.browser.infobar.InfoBarIdentifier; //导入依赖的package包/类
/**
 * Shows an infobar error message overriding the WindowAndroid implementation.
 */
@Override
protected void showCallbackNonExistentError(String error) {
    Activity activity = getActivity().get();

    // We can assume that activity is a ChromeActivity because we require one to be passed in
    // in the constructor.
    Tab tab = activity != null ? ((ChromeActivity) activity).getActivityTab() : null;

    if (tab != null) {
        SimpleConfirmInfoBarBuilder.create(
                tab, InfoBarIdentifier.CHROME_WINDOW_ERROR, error, false);
    } else {
        super.showCallbackNonExistentError(error);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:ChromeWindow.java

示例2: promptForFeedback

import org.chromium.chrome.browser.infobar.InfoBarIdentifier; //导入依赖的package包/类
private static void promptForFeedback(final Tab tab) {
    final ChromeActivity activity = tab.getActivity();
    SimpleConfirmInfoBarBuilder.Listener listener = new SimpleConfirmInfoBarBuilder.Listener() {
        @Override
        public void onInfoBarDismissed() {}

        @Override
        public boolean onInfoBarButtonClicked(boolean isPrimary) {
            if (isPrimary) {
                startFeedback(tab);
            } else {
                VrFeedbackStatus.setFeedbackOptOut(true);
            }
            return false;
        }
    };

    SimpleConfirmInfoBarBuilder.create(tab, listener,
            InfoBarIdentifier.VR_FEEDBACK_INFOBAR_ANDROID, R.drawable.vr_services,
            activity.getString(R.string.vr_shell_feedback_infobar_description),
            activity.getString(R.string.vr_shell_feedback_infobar_feedback_button),
            activity.getString(R.string.no_thanks), true /* autoExpire  */);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:24,代码来源:VrShellDelegate.java

示例3: promptToUpdateVrServices

import org.chromium.chrome.browser.infobar.InfoBarIdentifier; //导入依赖的package包/类
private static void promptToUpdateVrServices(int vrCoreCompatibility, Tab tab) {
    if (tab == null) {
        return;
    }
    final Activity activity = tab.getActivity();
    String infobarText;
    String buttonText;
    if (vrCoreCompatibility == VrCoreVersionChecker.VR_NOT_AVAILABLE) {
        // Supported, but not installed. Ask user to install instead of upgrade.
        infobarText = activity.getString(R.string.vr_services_check_infobar_install_text);
        buttonText = activity.getString(R.string.vr_services_check_infobar_install_button);
    } else if (vrCoreCompatibility == VrCoreVersionChecker.VR_OUT_OF_DATE) {
        infobarText = activity.getString(R.string.vr_services_check_infobar_update_text);
        buttonText = activity.getString(R.string.vr_services_check_infobar_update_button);
    } else {
        Log.e(TAG, "Unknown VrCore compatibility: " + vrCoreCompatibility);
        return;
    }

    SimpleConfirmInfoBarBuilder.Listener listener = new SimpleConfirmInfoBarBuilder.Listener() {
        @Override
        public void onInfoBarDismissed() {}

        @Override
        public boolean onInfoBarButtonClicked(boolean isPrimary) {
            activity.startActivity(
                    new Intent(Intent.ACTION_VIEW, Uri.parse(VR_CORE_MARKET_URI)));
            return false;
        }
    };
    SimpleConfirmInfoBarBuilder.create(tab, listener,
            InfoBarIdentifier.VR_SERVICES_UPGRADE_ANDROID, R.drawable.vr_services, infobarText,
            buttonText, null, true);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:35,代码来源:VrShellDelegate.java


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