Upstream version 10.39.234.0 31/29731/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Mon, 3 Nov 2014 10:24:24 +0000 (10:24 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Mon, 3 Nov 2014 10:24:24 +0000 (10:24 +0000)
Upstream commit-id 59641977340b393bdcd9b1bff2fad1541ab29009

Change-Id: I15395361dee99a13b04e1a6359cc72e9d108977a
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
packaging/crosswalk.spec
src/xwalk/VERSION
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkClient.java
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkContentsClientBridge.java
src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkResourceClientInternal.java

index 09854ff..7420b6f 100644 (file)
@@ -24,7 +24,7 @@
 %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+)
index a15c6ac..4efecb8 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=10
 MINOR=39
-BUILD=233
+BUILD=234
 PATCH=0
index 09854ff..7420b6f 100644 (file)
@@ -24,7 +24,7 @@
 %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+)
index 996a468..30b90d8 100644 (file)
@@ -40,7 +40,6 @@ import android.widget.TextView;
 public class XWalkClient {
 
     private Context mContext;
-    private AlertDialog mDialog;
     private XWalkViewInternal mXWalkView;
 
     public XWalkClient(XWalkViewInternal view) {
@@ -109,41 +108,6 @@ public class XWalkClient {
 
     /**
      * 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
index 0755f6f..e33d52b 100644 (file)
@@ -272,8 +272,8 @@ class XWalkContentsClientBridge extends XWalkContentsClient
 
     @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);
         }
     }
 
index e680232..381daaa 100644 (file)
@@ -7,7 +7,9 @@ package org.xwalk.core.internal;
 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;
 
 /**
@@ -218,4 +220,42 @@ public class XWalkResourceClientInternal {
     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();
+    }
 }