本文整理汇总了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);
}
}
示例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 */);
}
示例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);
}