Upstream version 7.35.143.0 80/21680/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Mon, 26 May 2014 09:36:58 +0000 (09:36 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Mon, 26 May 2014 09:36:58 +0000 (09:36 +0000)
Upstream commit-id fae60a11a3307c5f863c51f7ad5795a27e55cd08

Change-Id: I7463f000aaf8b795ca7c531c41dcd4aba1f4e2b3
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
17 files changed:
packaging/crosswalk.manifest
packaging/crosswalk.spec
src/ozone/wayland/wayland.gyp
src/xwalk/DEPS.xwalk
src/xwalk/VERSION
src/xwalk/application/tools/linux/xwalk_application_tools.gyp
src/xwalk/application/tools/linux/xwalk_launcher_main.cc
src/xwalk/application/tools/linux/xwalkctl_main.cc
src/xwalk/packaging/crosswalk.manifest
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContent.java
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkPreferences.java
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkView.java
src/xwalk/runtime/android/sample/AndroidManifest.xml
src/xwalk/runtime/android/sample/res/layout/animatable_xwview_layout.xml [new file with mode: 0644]
src/xwalk/runtime/android/sample/src/org/xwalk/core/sample/AnimatableXWalkViewActivity.java [new file with mode: 0644]
src/xwalk/runtime/browser/runtime_url_request_context_getter.cc

index 09fdd97..4715caf 100644 (file)
@@ -2,4 +2,10 @@
  <request>
     <domain name="_"/>
  </request>
-</manifest>
\ No newline at end of file
+ <assign>
+    <filesystem path="/usr/bin/xwalk" exec_label="User" />
+    <filesystem path="/usr/bin/xwalkctl" exec_label="User" />
+    <filesystem path="/usr/bin/xwalk-launcher" exec_label="User" />
+    <filesystem path="/usr/bin/xwalk-pkg-helper" exec_label="User" />
+ </assign>
+</manifest>
index 95cab71..29b4858 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.35.141.0
+Version:        7.35.143.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index b46fc33..9e4014c 100644 (file)
@@ -13,7 +13,7 @@
     'enable_xdg_shell%': '<(enable_xdg_shell)',
     'conditions': [
       ['sysroot!=""', {
-        'pkg-config': './pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
+        'pkg-config': '../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
       }, {
         'pkg-config': 'pkg-config'
       }],
index a7eca55..d76a991 100644 (file)
@@ -10,7 +10,7 @@ chromium_version = '35.0.1916.114'
 chromium_crosswalk_point = 'e76fa1eeaea6745b72a693cf746e5d3d8ece1bef'
 blink_crosswalk_point = '3cf743afc1a77a1141f08897c4f2c3b805124f25'
 v8_crosswalk_point = '64b8b78dee87a9d465f9d095e2021bdb9d45d37d'
-ozone_wayland_point = 'f4faec532d7d2f482b3ffe1e52be6fa3e6fc8629'
+ozone_wayland_point = '55f39c62b461b92d3b0b912c7c80ae98d866b5a6'
 
 deps_xwalk = {
   'src': 'https://github.com/crosswalk-project/chromium-crosswalk.git@%s' % chromium_crosswalk_point,
index 7068d33..a9f49de 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=7
 MINOR=35
-BUILD=141
+BUILD=143
 PATCH=0
index bafe531..df49620 100644 (file)
         '../../../..',
       ],
       'sources': [
-        'dbus_connection.h',
         'dbus_connection.cc',
-        'xwalk_tizen_user.h',
-        'xwalk_tizen_user.cc',
+        'dbus_connection.h',
         'xwalkctl_main.cc',
       ],
+      'conditions' : [
+        ['tizen==1', {
+          'sources': [
+            'xwalk_tizen_user.cc',
+            'xwalk_tizen_user.h',
+          ],
+        }],
+      ],
     },
     {
       'target_name': 'xwalk_launcher',
         '../../../extensions/extensions.gyp:xwalk_extensions',
       ],
       'sources': [
-        'dbus_connection.h',
         'dbus_connection.cc',
-        'xwalk_extension_process_launcher.h',
+        'dbus_connection.h',
         'xwalk_extension_process_launcher.cc',
-        'xwalk_tizen_user.h',
-        'xwalk_tizen_user.cc',
+        'xwalk_extension_process_launcher.h',
         'xwalk_launcher_main.cc',
       ],
       'conditions' : [
@@ -71,6 +75,8 @@
           'sources': [
             'xwalk_launcher_tizen.cc',
             'xwalk_launcher_tizen.h',
+            'xwalk_tizen_user.cc',
+            'xwalk_tizen_user.h',
           ],
         }],
       ],
index 4718ce3..bf0b57a 100644 (file)
 
 #include "xwalk/application/tools/linux/dbus_connection.h"
 #include "xwalk/application/tools/linux/xwalk_extension_process_launcher.h"
+#if defined(OS_TIZEN)
 #include "xwalk/application/tools/linux/xwalk_launcher_tizen.h"
 #include "xwalk/application/tools/linux/xwalk_tizen_user.h"
+#endif
 
 static const char* xwalk_service_name = "org.crosswalkproject.Runtime1";
 static const char* xwalk_running_path = "/running1";
@@ -243,8 +245,10 @@ int main(int argc, char** argv) {
   g_type_init();
 #endif
 
+#if defined(OS_TIZEN)
   if (xwalk_tizen_check_user_app())
     exit(1);
+#endif
 
   GOptionContext* context =
       g_option_context_new("- Crosswalk Application Launcher");
index dd477ae..318b8fb 100644 (file)
@@ -11,7 +11,9 @@
 #include <locale.h>
 
 #include "xwalk/application/tools/linux/dbus_connection.h"
+#if defined(OS_TIZEN)
 #include "xwalk/application/tools/linux/xwalk_tizen_user.h"
+#endif
 
 static const char* xwalk_service_name = "org.crosswalkproject.Runtime1";
 static const char* xwalk_installed_path = "/installed1";
@@ -183,8 +185,10 @@ int main(int argc, char* argv[]) {
   g_type_init();
 #endif
 
+#if defined(OS_TIZEN)
   if (xwalk_tizen_check_user_app())
     exit(1);
+#endif
 
   context = g_option_context_new("- Crosswalk Application Management");
   g_option_context_add_main_entries(context, entries, NULL);
index 09fdd97..4715caf 100644 (file)
@@ -2,4 +2,10 @@
  <request>
     <domain name="_"/>
  </request>
-</manifest>
\ No newline at end of file
+ <assign>
+    <filesystem path="/usr/bin/xwalk" exec_label="User" />
+    <filesystem path="/usr/bin/xwalkctl" exec_label="User" />
+    <filesystem path="/usr/bin/xwalk-launcher" exec_label="User" />
+    <filesystem path="/usr/bin/xwalk-pkg-helper" exec_label="User" />
+ </assign>
+</manifest>
index 95cab71..29b4858 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.35.141.0
+Version:        7.35.143.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index ea3f43f..117a66d 100644 (file)
@@ -29,6 +29,7 @@ import org.chromium.components.navigation_interception.InterceptNavigationDelega
 import org.chromium.content.browser.ContentView;
 import org.chromium.content.browser.ContentViewCore;
 import org.chromium.content.browser.ContentViewRenderView;
+import org.chromium.content.browser.ContentViewRenderView.CompositingSurfaceType;
 import org.chromium.content.browser.ContentViewStatics;
 import org.chromium.content.browser.LoadUrlParams;
 import org.chromium.content.browser.NavigationHistory;
@@ -75,7 +76,10 @@ class XWalkContent extends FrameLayout implements XWalkPreferences.KeyValueChang
         mWindow = new ActivityWindowAndroid(xwView.getActivity());
 
         // Initialize ContentViewRenderView
-        mContentViewRenderView = new ContentViewRenderView(context, mWindow) {
+        boolean animated = XWalkPreferences.getValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW);
+        CompositingSurfaceType surfaceType =
+                animated ? CompositingSurfaceType.TEXTURE_VIEW : CompositingSurfaceType.SURFACE_VIEW;
+        mContentViewRenderView = new ContentViewRenderView(context, mWindow, surfaceType) {
             protected void onReadyToRender() {
                 if (mPendingUrl != null) {
                     doLoadUrl(mPendingUrl, mPendingData);
index 08a0b78..6605711 100644 (file)
@@ -30,8 +30,33 @@ public final class XWalkPreferences {
      */
     public static final String REMOTE_DEBUGGING = "remote-debugging";
 
+    /**
+     * The key string to enable/disable animatable XWalkView. Default value is
+     * false.
+     *
+     * If this key is set to True, the XWalkView created by Crosswalk can be
+     * transformed and animated. Internally, Crosswalk is alternatively using
+     * TextureView as the backend of XWalkView.
+     *
+     * <a href="http://developer.android.com/reference/android/view/TextureView.html">
+     * TextureView</a> is a kind of
+     * <a href="http://developer.android.com/reference/android/view/View.html">
+     * android.view.View</a> that is different from
+     * <a href="http://developer.android.com/reference/android/view/SurfaceView.html">
+     * SurfaceView</a>. Unlike SurfaceView, it can be resized, transformed and
+     * animated. Once this key is set to True, all XWalkView will use TextureView
+     * as the rendering target instead of SurfaceView. The downside of TextureView
+     * is, it would consume more graphics memory than SurfaceView and may have
+     * 1~3 extra frames of latency to display updates.
+     *
+     * Note this key MUST be set before creating the first XWalkView, otherwise
+     * a RuntimeException will be thrown.
+     */
+    public static final String ANIMATABLE_XWALK_VIEW = "animatable-xwalk-view";
+
     static {
         sPrefMap.put(REMOTE_DEBUGGING, Boolean.FALSE);
+        sPrefMap.put(ANIMATABLE_XWALK_VIEW, Boolean.FALSE);
     }
 
     /**
@@ -42,6 +67,12 @@ public final class XWalkPreferences {
      */
     public static synchronized void setValue(String key, boolean enabled) throws RuntimeException {
         checkKey(key);
+        // If the listener list is not empty, we consider the preference is
+        // loaded by Crosswalk and taken effect already.
+        if (key == ANIMATABLE_XWALK_VIEW && !sListeners.isEmpty()) {
+            throw new RuntimeException("Warning: the preference key " + key +
+                    " can not be set if the preference is already loaded by Crosswalk");
+        }
         if (sPrefMap.get(key) != enabled) {
             sPrefMap.put(key, new Boolean(enabled));
             onKeyValueChanged(key, enabled);
index c7e0288..c46ff78 100644 (file)
@@ -32,9 +32,13 @@ import org.xwalk.core.extension.XWalkExtensionManager;
  * <p>XWalkView represents an Android view for web apps/pages. Thus most of attributes
  * for Android view are valid for this class. Since it internally uses
  * <a href="http://developer.android.com/reference/android/view/SurfaceView.html">
- * android.view.SurfaceView</a> for rendering web pages, it can't be resized, rotated,
- * transformed and animated due to the limitations of SurfaceView. Besides, XWalkView won't
- * be rendered if it's invisible.</p>
+ * android.view.SurfaceView</a> for rendering web pages by default, it can't be resized,
+ * rotated, transformed and animated due to the limitations of SurfaceView.
+ * Alternatively, if the preference key {@link XWalkPreferences#ANIMATABLE_XWALK_VIEW}
+ * is set to True, XWalkView can be transformed and animated because
+ * <a href="http://developer.android.com/reference/android/view/TextureView.html">
+ * TextureView</a> is intentionally used to render web pages for animation support.
+ * Besides, XWalkView won't be rendered if it's invisible.</p>
  *
  * <p>XWalkView needs hardware acceleration to render web pages. As a result, the
  * AndroidManifest.xml of the caller's app must be appended with the attribute
@@ -578,7 +582,7 @@ public class XWalkView extends android.widget.FrameLayout {
      */
     // TODO(yongsheng): make it static?
     public String getAPIVersion() {
-        return "1.0";
+        return "2.0";
     }
 
     /**
index 04c620c..d8d479b 100644 (file)
                 <category android:name="android.intent.category.SAMPLE_CODE" />
             </intent-filter>
         </activity>
+        <activity
+            android:name=".AnimatableXWalkViewActivity"
+            android:label="Animatable XWalkView"
+            android:parentActivityName=".XWalkEmbeddedAPISample" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
     </application>
 
 </manifest>
diff --git a/src/xwalk/runtime/android/sample/res/layout/animatable_xwview_layout.xml b/src/xwalk/runtime/android/sample/res/layout/animatable_xwview_layout.xml
new file mode 100644 (file)
index 0000000..766f490
--- /dev/null
@@ -0,0 +1,23 @@
+<!--
+ Copyright (c) 2014 Intel Corporation. All rights reserved.
+
+     Use of this source code is governed by a BSD-style license that can be
+     found in the LICENSE file.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+             android:layout_width="match_parent"
+             android:layout_height="match_parent"
+             android:orientation="vertical">
+  <Button   android:id="@+id/run_animation"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="right"
+            android:text="Run Animation" />
+
+  <org.xwalk.core.XWalkView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/xwalkview"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+  </org.xwalk.core.XWalkView>
+
+</LinearLayout>
diff --git a/src/xwalk/runtime/android/sample/src/org/xwalk/core/sample/AnimatableXWalkViewActivity.java b/src/xwalk/runtime/android/sample/src/org/xwalk/core/sample/AnimatableXWalkViewActivity.java
new file mode 100644 (file)
index 0000000..18f750b
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (c) 2014 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.xwalk.core.sample;
+
+import org.xwalk.core.XWalkView;
+import org.xwalk.core.XWalkPreferences;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.view.View;
+
+/**
+ * Sample code to show how to use ANIMATED_XWALK_VIEW preference key to create
+ * animated XWalkView and apply alpha animation or scale animation on it.
+ */
+public class AnimatableXWalkViewActivity extends XWalkBaseActivity {
+    private final static float ANIMATION_FACTOR = 0.6f;
+    private Button mRunAnimationButton;
+
+    private void startAnimation() {
+        AnimatorSet combo = new AnimatorSet();
+
+        float targetAlpha = mXWalkView.getAlpha() == 1.f ? ANIMATION_FACTOR : 1.f;
+        float targetScaleFactor = mXWalkView.getScaleX() == 1.f ? ANIMATION_FACTOR : 1.f;
+
+        ObjectAnimator fade = ObjectAnimator.ofFloat(mXWalkView,
+                "alpha", mXWalkView.getAlpha(), targetAlpha);
+        ObjectAnimator scaleX = ObjectAnimator.ofFloat(mXWalkView,
+                "scaleX", mXWalkView.getScaleX(), targetScaleFactor);
+        ObjectAnimator scaleY = ObjectAnimator.ofFloat(mXWalkView,
+                "scaleY", mXWalkView.getScaleY(), targetScaleFactor);
+
+        combo.setDuration(400);
+        combo.playTogether(fade, scaleX, scaleY);
+        combo.start();
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // ANIMATABLE_XWALK_VIEW preference key MUST be set before XWalkView creation.
+        XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, true);
+
+        setContentView(R.layout.animatable_xwview_layout);
+
+        mRunAnimationButton = (Button) findViewById(R.id.run_animation);
+        mRunAnimationButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startAnimation();
+            }
+        });
+
+        mXWalkView = (XWalkView) findViewById(R.id.xwalkview);
+        mXWalkView.load("http://www.baidu.com", null);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+
+        // Reset the preference for animatable XWalkView.
+        XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);
+    }
+}
index 7509218..c38579b 100644 (file)
@@ -97,9 +97,16 @@ net::URLRequestContext* RuntimeURLRequestContextGetter::GetURLRequestContext() {
         content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES,
         NULL, NULL);
     net::CookieStore* cookie_store = content::CreateCookieStore(cookie_config);
-    const char* schemes[] = {application::kApplicationScheme,
-                             content::kChromeDevToolsScheme};
-    cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 2);
+
+    std::vector<const char*> cookieable_schemes(
+        net::CookieMonster::kDefaultCookieableSchemes,
+        net::CookieMonster::kDefaultCookieableSchemes +
+            net::CookieMonster::kDefaultCookieableSchemesCount - 1);
+    cookieable_schemes.push_back(application::kApplicationScheme);
+    cookieable_schemes.push_back(content::kChromeDevToolsScheme);
+
+    cookie_store->GetCookieMonster()->SetCookieableSchemes(
+        &cookieable_schemes[0], cookieable_schemes.size());
     storage_->set_cookie_store(cookie_store);
 #endif
     storage_->set_server_bound_cert_service(new net::ServerBoundCertService(