%define _binary_payload w3.gzdio
Name: crosswalk
-Version: 10.39.233.0
+Version: 10.39.234.0
Release: 0
Summary: Chromium-based app runtime
License: (BSD-3-Clause and LGPL-2.1+)
MAJOR=10
MINOR=39
-BUILD=233
+BUILD=234
PATCH=0
%define _binary_payload w3.gzdio
Name: crosswalk
-Version: 10.39.233.0
+Version: 10.39.234.0
Release: 0
Summary: Chromium-based app runtime
License: (BSD-3-Clause and LGPL-2.1+)
public class XWalkClient {
private Context mContext;
- private AlertDialog mDialog;
private XWalkViewInternal mXWalkView;
public XWalkClient(XWalkViewInternal view) {
/**
* Notify the host application that an SSL error occurred while loading a
- * resource. The host application must call either handler.cancel() or
- * handler.proceed(). Note that the decision may be retained for use in
- * response to future SSL errors. The default behavior is to cancel the
- * load.
- *
- * @param view The XWalkViewInternal that is initiating the callback.
- * @param callback The callback class. Passing 'true' means accepting the
- * ssl error and continue to load. Passing 'false' means
- * forbidding to load the web page.
- * @param error The SSL error object.
- */
- public void onReceivedSslError(XWalkViewInternal view, ValueCallback<Boolean> callback,
- SslError error) {
- final ValueCallback<Boolean> valueCallback = callback;
- AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext);
- // Don't use setOnDismissListener as it requires API level 17.
- dialogBuilder.setTitle(R.string.ssl_alert_title)
- .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- valueCallback.onReceiveValue(true);
- dialog.dismiss();
- }
- }).setNegativeButton(android.R.string.cancel, null)
- .setOnCancelListener(new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- valueCallback.onReceiveValue(false);
- }
- });
- mDialog = dialogBuilder.create();
- mDialog.show();
- }
-
- /**
- * Notify the host application that an SSL error occurred while loading a
* resource, but the XWalkViewInternal chose to proceed anyway based on a
* decision retained from a previous response to onReceivedSslError().
* @hide
@Override
public void onReceivedSslError(ValueCallback<Boolean> callback, SslError error) {
- if (mXWalkClient != null && isOwnerActivityRunning()) {
- mXWalkClient.onReceivedSslError(mXWalkView, callback, error);
+ if (mXWalkResourceClient != null && isOwnerActivityRunning()) {
+ mXWalkResourceClient.onReceivedSslError(mXWalkView, callback, error);
}
}
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.net.http.SslError;
import android.view.View;
+import android.webkit.ValueCallback;
import android.webkit.WebResourceResponse;
/**
public boolean shouldOverrideUrlLoading(XWalkViewInternal view, String url) {
return false;
}
+
+ /**
+ * Notify the host application that an SSL error occurred while loading a
+ * resource. The host application must call either callback.onReceivedValue(true)
+ * or callback.onReceivedValue(false) . Note that the decision may be retained for
+ * use in response to future SSL errors. The default behavior is to pop up a dialog
+ * @param view the xwalkview that is initiating the callback
+ * @param callback passing 'true' means accepting the ssl error and continue to load.
+ * passing 'false' means forbidding to load the web page.
+ * @param error the SSL error object
+ * @since 4.0
+ */
+ @XWalkAPI
+ public void onReceivedSslError(XWalkViewInternal view, ValueCallback<Boolean> callback,
+ SslError error) {
+ final ValueCallback<Boolean> valueCallback = callback;
+ AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(view.getContext());
+ dialogBuilder.setTitle(R.string.ssl_alert_title)
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ valueCallback.onReceiveValue(true);
+ dialog.dismiss();
+ }
+ }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ valueCallback.onReceiveValue(false);
+ dialog.dismiss();
+ }
+ }).setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ valueCallback.onReceiveValue(false);
+ }
+ });
+ dialogBuilder.create().show();
+ }
}