%endif
Name: crosswalk
-Version: 8.36.169.0
+Version: 8.36.171.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
MAJOR=8
MINOR=36
-BUILD=169
+BUILD=171
PATCH=0
'icon.' + icon_suffix))
icon_name = 'icon'
elif icon and (not os.path.isfile(icon)):
- print ('Error: Please make sure \"' + icon + '\" does exist!')
+ print('Error: "%s" does not exist.' % icon)
sys.exit(6)
break
return icon_name
icon_name = os.path.splitext(icon_file)[0]
return icon_name
else:
- print ('Error: Please make sure \"' + icon + '\" is a file!')
+ print('Error: "%s" does not exist.')
sys.exit(6)
if os.path.isfile(x86_native_lib_path):
native_lib_path += os.path.join('native_libs', 'x86', 'libs')
else:
- print('Missing x86 native library for Crosswalk embedded APK. Abort!')
+ print('No x86 native library has been found for creating a Crosswalk '
+ 'embedded APK.')
sys.exit(10)
elif options.arch == 'arm':
arm_native_lib_path = os.path.join('native_libs', 'armeabi-v7a', 'libs',
if os.path.isfile(arm_native_lib_path):
native_lib_path += os.path.join('native_libs', 'armeabi-v7a', 'libs')
else:
- print('Missing ARM native library for Crosswalk embedded APK. Abort!')
+ print('No ARM native library has been found for creating a Crosswalk '
+ 'embedded APK.')
sys.exit(10)
# A space is needed for Windows.
native_lib_path += ' '
print(GetVersion('VERSION'))
return 0
else:
- parser.error('Can\'t get version due to the VERSION file missing!')
+ parser.error('VERSION was not found, so Crosswalk\'s version could not '
+ 'be determined.')
xpk_temp_dir = ''
if options.xpk:
if options.package:
VerifyAppName(options.package, 'packagename')
else:
- parser.error('The package name is required! '
- 'Please use "--package" option.')
+ parser.error('A package name is required. Please use the "--package" '
+ 'option.')
if options.name:
VerifyAppName(options.name)
app_info.original_name = options.name
options.name = ReplaceSpaceWithUnderscore(options.name)
else:
- parser.error('The APK name is required! Please use "--name" option.')
+ parser.error('An APK name is required. Please use the "--name" option.')
# The checks here are really convoluted, but at the moment make_apk
# misbehaves any of the following conditions is true.
'--package=org.xwalk.example', self._mode]
out = RunCommand(cmd)
Clean('Example', '1.0.0')
- self.assertTrue(out.find('The APK name is required!') != -1)
+ self.assertIn('An APK name is required', out)
cmd = ['python', 'make_apk.py', '--name=Test_Example',
'--app-version=1.0.0', '--app-url=http://www.intel.com',
'--package=org.xwalk.example', self._mode]
out = RunCommand(cmd)
- self.assertTrue(out.find('The APK name is required!') == -1)
+ self.assertNotIn('An APK name is required', out)
Clean('Test_Example', '1.0.0')
invalid_chars = '\/:.*?"<>|-'
self._mode]
out = RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
- self.assertTrue(out.find('The package name is required!') != -1)
+ self.assertIn('A package name is required', out)
Clean('Example', '1.0.0')
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', self._mode]
out = RunCommand(cmd)
- self.assertTrue(out.find('The package name is required!') == -1)
+ self.assertNotIn('A package name is required', out)
def testEntry(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
int priority = arraysize(kDefaultWidgetEntryPage);
for (base::FilePath file = iter.Next(); !file.empty(); file = iter.Next()) {
- for (int i = 0; i < arraysize(kDefaultWidgetEntryPage); ++i) {
+ for (size_t i = 0; i < arraysize(kDefaultWidgetEntryPage); ++i) {
if (file.BaseName().MaybeAsASCII() == kDefaultWidgetEntryPage[i] &&
i < priority) {
entry_page = kDefaultWidgetEntryPage[i];
Application* ApplicationService::Launch(
const std::string& id, const Application::LaunchParams& params) {
- Application* application = NULL;
scoped_refptr<ApplicationData> application_data =
application_storage_->GetApplicationData(id);
if (!application_data) {
Application* ApplicationService::Launch(
const base::FilePath& path, const Application::LaunchParams& params) {
- Application* application = NULL;
if (!base::DirectoryExists(path))
return NULL;
%endif
Name: crosswalk
-Version: 8.36.169.0
+Version: 8.36.171.0
Release: 0
Summary: Crosswalk is an app runtime based on Chromium
License: (BSD-3-Clause and LGPL-2.1+)
* {@link XWalkUIClient} for listening to the events related to resource loading and UI.
* By default, Crosswalk has a default implementation. Callers can override them if needed.</p>
*
- * <p>Unlike other Android views, this class has to listen to system events like application life
- * cycle, intents, and activity result. The web engine inside this view need to get and handle
- * them. And the onDestroy() method of XWalkView MUST be called explicitly when an XWalkView
- * won't be used anymore, otherwise it will cause the memory leak from the native side of the web
- * engine. It's similar to the
- * <a href="http://developer.android.com/reference/android/webkit/WebView.html#destroy()">
- * destroy()</a> method of Android WebView. For example:</p>
+ * <p>Unlike other Android views, this class has to listen to system events like intents and activity result.
+ * The web engine inside this view need to get and handle them.
+ * With contianer activity's lifecycle change, XWalkView will pause all timers and other
+ * components like videos when activity paused, resume back them when activity resumed.
+ * When activity is about to destroy, XWalkView will destroy itself as well.
+ * Embedders can also call onHide() and pauseTimers() to explicitly pause XWalkView.
+ * Similarily with onShow(), resumeTimers() and onDestroy().
+ *
+ * For example:</p>
*
* <pre>
* import android.app.Activity;
/**
* Pause all layout, parsing and JavaScript timers for all XWalkView instances.
- * Typically it should be called when the activity for this view is paused,
- * and accordingly {@link #resumeTimers} should be called when the activity
- * is resumed again.
+ * It will be called when the container Activity get paused. It can also be explicitly
+ * called to pause timers.
*
* Note that it will globally impact all XWalkView instances, not limited to
* just this XWalkView.
/**
* Resume all layout, parsing and JavaScript timers for all XWalkView instances.
- * Typically it should be called when the activity for this view is resumed.
+ * It will be called when the container Activity get resumed. It can also be explicitly
+ * called to resume timers.
*
* Note that it will globally impact all XWalkView instances, not limited to
* just this XWalkView.
* Pause many other things except JavaScript timers inside rendering engine,
* like video player, modal dialogs, etc. See {@link #pauseTimers} about pausing
* JavaScript timers.
- * Typically it should be called when the activity for this view is paused.
+ * It will be called when the container Activity get paused. It can also be explicitly
+ * called to pause above things.
* @since 1.0
*/
public void onHide() {
/**
* Resume video player, modal dialogs. Embedders are in charge of calling
* this during resuming this activity if they call onHide.
- * Typically it should be called when the activity for this view is resumed.
+ * It will be called when the container Activity get resumed. It can also be explicitly
+ * called to resume above things.
* @since 1.0
*/
public void onShow() {
/**
* Release internal resources occupied by this XWalkView.
+ * It will be called when the container Activity get destroyed. It can also be explicitly
+ * called to release resources.
* @since 1.0
*/
public void onDestroy() {
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
+import org.chromium.base.ApplicationStatus.ActivityStateListener;
import org.xwalk.core.internal.extension.XWalkExtensionManager;
import org.xwalk.core.internal.extension.XWalkPathHelper;
* {@link XWalkUIClientInternal} for listening to the events related to resource loading and UI.
* By default, Crosswalk has a default implementation. Callers can override them if needed.</p>
*
- * <p>Unlike other Android views, this class has to listen to system events like application life
- * cycle, intents, and activity result. The web engine inside this view need to get and handle
- * them. And the onDestroy() method of XWalkViewInternal MUST be called explicitly when an XWalkViewInternal
- * won't be used anymore, otherwise it will cause the memory leak from the native side of the web
- * engine. It's similar to the
- * <a href="http://developer.android.com/reference/android/webkit/WebView.html#destroy()">
- * destroy()</a> method of Android WebView. For example:</p>
+ * <p>Unlike other Android views, this class has to listen to system events like intents and activity result.
+ * The web engine inside this view need to get and handle them.
+ * With contianer activity's lifecycle change, XWalkViewInternal will pause all timers and other
+ * components like videos when activity paused, resume back them when activity resumed.
+ * When activity is about to destroy, XWalkViewInternal will destroy itself as well.
+ * Embedders can also call onHide() and pauseTimers() to explicitly pause XWalkViewInternal.
+ * Similarily with onShow(), resumeTimers() and onDestroy().
+ *
+ * For example:</p>
*
* <pre>
* import android.app.Activity;
* }
*
* @Override
- * protected void onPause() {
- * super.onPause();
- * if (mXwalkView != null) {
- * mXwalkView.pauseTimers();
- * mXwalkView.onHide();
- * }
- * }
- *
- * @Override
- * protected void onResume() {
- * super.onResume();
- * if (mXwalkView != null) {
- * mXwalkView.resumeTimers();
- * mXwalkView.onShow();
- * }
- * }
- *
- * @Override
- * protected void onDestroy() {
- * super.onDestroy();
- * if (mXwalkView != null) {
- * mXwalkView.onDestroy();
- * }
- * }
- *
- * @Override
* protected void onActivityResult(int requestCode, int resultCode, Intent data) {
* if (mXwalkView != null) {
* mXwalkView.onActivityResult(requestCode, resultCode, data);
* }
* </pre>
*/
-public class XWalkViewInternal extends android.widget.FrameLayout {
+public class XWalkViewInternal extends android.widget.FrameLayout
+ implements ActivityStateListener {
static final String PLAYSTORE_DETAIL_URI = "market://details?id=";
// Intialize library, paks and others.
try {
XWalkViewDelegate.init(this);
+ ApplicationStatus.registerStateListenerForActivity(this, getActivity());
} catch (Throwable e) {
// Try to find if there is UnsatisfiedLinkError in the cause chain of the met Throwable.
Throwable linkError = e;
/**
* Pause all layout, parsing and JavaScript timers for all XWalkViewInternal instances.
- * Typically it should be called when the activity for this view is paused,
- * and accordingly {@link #resumeTimers} should be called when the activity
- * is resumed again.
+ * It will be called when the container Activity get paused. It can also be explicitly
+ * called to pause timers.
*
* Note that it will globally impact all XWalkViewInternal instances, not limited to
* just this XWalkViewInternal.
/**
* Resume all layout, parsing and JavaScript timers for all XWalkViewInternal instances.
- * Typically it should be called when the activity for this view is resumed.
+ * It will be called when the container Activity get resumed. It can also be explicitly
+ * called to resume timers.
*
* Note that it will globally impact all XWalkViewInternal instances, not limited to
* just this XWalkViewInternal.
* Pause many other things except JavaScript timers inside rendering engine,
* like video player, modal dialogs, etc. See {@link #pauseTimers} about pausing
* JavaScript timers.
- * Typically it should be called when the activity for this view is paused.
+ * It will be called when the container Activity get paused. It can also be explicitly
+ * called to pause above things.
* @since 1.0
*/
public void onHide() {
* Resume video player, modal dialogs. Embedders are in charge of calling
* this during resuming this activity if they call onHide.
* Typically it should be called when the activity for this view is resumed.
+ * It will be called when the container Activity get resumed. It can also be explicitly
+ * called to resume above things.
* @since 1.0
*/
public void onShow() {
/**
* Release internal resources occupied by this XWalkViewInternal.
+ * It will be called when the container Activity get destroyed. It can also be explicitly
+ * called to release resources.
* @since 1.0
*/
public void onDestroy() {
}
return super.dispatchKeyEvent(event);
}
+
+ /**
+ * @hide
+ */
+ @Override
+ public void onActivityStateChange(Activity activity, int newState) {
+ assert(getActivity() == activity);
+ switch (newState) {
+ case ActivityState.PAUSED:
+ pauseTimers();
+ onHide();
+ break;
+ case ActivityState.RESUMED:
+ onShow();
+ resumeTimers();
+ break;
+ case ActivityState.DESTROYED:
+ onDestroy();
+ break;
+ default:
+ break;
+ }
+ }
}
}
@Override
- public void onPause() {
- super.onPause();
- mSectionsPagerAdapter.onPause();
- }
-
- @Override
- public void onResume() {
- super.onResume();
- mSectionsPagerAdapter.onResume();
- }
-
- @Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(mReceiver);
unregisterTracingReceiver();
- mSectionsPagerAdapter.onDestroy();
}
@Override
@Override
public void onResume() {
- mXWalkView.resumeTimers();
- mXWalkView.onShow();
}
@Override
public void onPause() {
- mXWalkView.pauseTimers();
- mXWalkView.onHide();
}
@Override
public void onDestroy() {
- mXWalkView.onDestroy();
}
@Override
mXWalkView.load("http://www.intel.com", null);
mXWalkView2.load("http://www.baidu.com", null);
}
-
- @Override
- public void onPause() {
- super.onPause();
- if (mXWalkView2 != null) {
- mXWalkView2.onHide();
- mXWalkView2.pauseTimers();
- }
- }
-
- @Override
- public void onResume() {
- super.onResume();
- if (mXWalkView2 != null) {
- mXWalkView2.onShow();
- mXWalkView2.resumeTimers();
- }
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- if (mXWalkView2 != null) {
- mXWalkView2.onDestroy();
- }
- }
}
public class XWalkBaseActivity extends Activity {
protected XWalkView mXWalkView;
-
- /*
- * When the activity is paused, XWalkView.onHide() and XWalkView.pauseTimers() need to be called.
- */
- @Override
- public void onPause() {
- super.onPause();
- if (mXWalkView != null) {
- mXWalkView.onHide();
- mXWalkView.pauseTimers();
- }
- }
-
- /*
- * When the activity is resumed, XWalkView.onShow() and XWalkView.resumeTimers() need to be called.
- */
- @Override
- public void onResume() {
- super.onResume();
- if (mXWalkView != null) {
- mXWalkView.onShow();
- mXWalkView.resumeTimers();
- }
- }
-
- /*
- * Call onDestroy on XWalkView to release native resources when the activity is destroyed.
- */
- @Override
- public void onDestroy() {
- super.onDestroy();
- if (mXWalkView != null) {
- mXWalkView.onDestroy();
- }
- }
}
#include "ui/gfx/screen.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
-#include "xwalk/runtime/browser/ui/splash_screen.h"
+#include "xwalk/runtime/browser/ui/splash_screen_tizen.h"
#include "xwalk/runtime/browser/ui/top_view_layout_views.h"
#include "xwalk/runtime/browser/xwalk_browser_main_parts_tizen.h"
const base::FilePath& splash_screen_path = create_params().splash_screen_path;
if (!splash_screen_path.empty()) {
- splash_screen_.reset(new SplashScreen(
+ splash_screen_.reset(new SplashScreenTizen(
GetWidget(), splash_screen_path, create_params().web_contents));
splash_screen_->Start();
}
namespace xwalk {
-class SplashScreen;
+class SplashScreenTizen;
// Tizen uses the Views native window but adds its own features like orientation
// handling and integration with system indicator bar.
gfx::Display display_;
blink::WebScreenOrientationLockType orientation_lock_;
- scoped_ptr<SplashScreen> splash_screen_;
+ scoped_ptr<SplashScreenTizen> splash_screen_;
DISALLOW_COPY_AND_ASSIGN(NativeAppWindowTizen);
};
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "xwalk/runtime/browser/ui/splash_screen.h"
+#include "xwalk/runtime/browser/ui/splash_screen_tizen.h"
#include "base/location.h"
#include "ui/compositor/layer.h"
const int kHideAnimationDuration = 1; // second
} // namespace
-class SplashScreen::SplashScreenLayerDelegate : public ui::LayerDelegate {
+class SplashScreenTizen::SplashScreenLayerDelegate : public ui::LayerDelegate {
public:
SplashScreenLayerDelegate() {}
DISALLOW_COPY_AND_ASSIGN(SplashScreenLayerDelegate);
};
-SplashScreen::SplashScreen(views::Widget* host,
- const base::FilePath& file,
- content::WebContents* web_contents)
+SplashScreenTizen::SplashScreenTizen(views::Widget* host,
+ const base::FilePath& file,
+ content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
widget_host_(host),
splash_screen_image_(file),
layer_->set_delegate(layer_delegate_.get());
}
-SplashScreen::~SplashScreen() {}
+SplashScreenTizen::~SplashScreenTizen() {}
-void SplashScreen::Start() {
+void SplashScreenTizen::Start() {
DCHECK(widget_host_);
if (is_started)
return;
}
}
-void SplashScreen::Stop() {
+void SplashScreenTizen::Stop() {
DCHECK(widget_host_);
if (!is_started)
return;
layer_->SetOpacity(0.0f);
}
-void SplashScreen::DidFinishLoad(int64 frame_id,
- const GURL& validated_url,
- bool is_main_frame,
- content::RenderViewHost* render_view_host) {
+void SplashScreenTizen::DidFinishLoad(
+ int64 frame_id,
+ const GURL& validated_url,
+ bool is_main_frame,
+ content::RenderViewHost* render_view_host) {
Stop();
}
-void SplashScreen::DidFailLoad(int64 frame_id,
- const GURL& validated_url,
- bool is_main_frame,
- int error_code,
- const base::string16& error_description,
- content::RenderViewHost* render_view_host) {
+void SplashScreenTizen::DidFailLoad(
+ int64 frame_id,
+ const GURL& validated_url,
+ bool is_main_frame,
+ int error_code,
+ const base::string16& error_description,
+ content::RenderViewHost* render_view_host) {
Stop();
}
-void SplashScreen::OnImplicitAnimationsCompleted() {
+void SplashScreenTizen::OnImplicitAnimationsCompleted() {
DCHECK(widget_host_);
widget_host_->GetLayer()->Remove(layer_.get());
}
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_
-#define XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_
+#ifndef XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_TIZEN_H_
+#define XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_TIZEN_H_
#include "base/files/file_path.h"
#include "content/public/browser/web_contents_observer.h"
namespace xwalk {
-class SplashScreen : public content::WebContentsObserver,
- public ui::ImplicitAnimationObserver {
+class SplashScreenTizen : public content::WebContentsObserver,
+ public ui::ImplicitAnimationObserver {
public:
- SplashScreen(views::Widget* host,
- const base::FilePath& file,
- content::WebContents* web_contents);
- ~SplashScreen();
+ SplashScreenTizen(views::Widget* host,
+ const base::FilePath& file,
+ content::WebContents* web_contents);
+ ~SplashScreenTizen();
void Start();
void Stop();
bool is_started;
- DISALLOW_COPY_AND_ASSIGN(SplashScreen);
+ DISALLOW_COPY_AND_ASSIGN(SplashScreenTizen);
};
} // namespace xwalk
-#endif // XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_
+#endif // XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_TIZEN_H_
package org.xwalk.runtime.client.test;
import android.test.suitebuilder.annotation.SmallTest;
+import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.xwalk.runtime.client.shell.XWalkRuntimeClientShellActivity;
import org.xwalk.test.util.RuntimeClientApiTestBase;
*/
public class PauseResumeTest extends XWalkRuntimeClientTestBase {
- @SmallTest
- @Feature({"PauseResume"})
+ // @SmallTest
+ // @Feature({"PauseResume"})
+ @DisabledTest
public void testPauseAndResume() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientShellActivity>(
package org.xwalk.runtime.client.embedded.test;
import android.test.suitebuilder.annotation.SmallTest;
+import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.xwalk.runtime.client.embedded.shell.XWalkRuntimeClientEmbeddedShellActivity;
import org.xwalk.test.util.RuntimeClientApiTestBase;
*/
public class PauseResumeTest extends XWalkRuntimeClientTestBase {
- @SmallTest
- @Feature({"PauseResume"})
+ // @SmallTest
+ // @Feature({"PauseResume"})
+ @DisabledTest
public void testPauseAndResume() throws Throwable {
RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity> helper =
new RuntimeClientApiTestBase<XWalkRuntimeClientEmbeddedShellActivity>(
'runtime/browser/ui/native_app_window_tizen.h',
'runtime/browser/ui/native_app_window_views.cc',
'runtime/browser/ui/native_app_window_views.h',
- 'runtime/browser/ui/splash_screen.cc',
- 'runtime/browser/ui/splash_screen.h',
+ 'runtime/browser/ui/splash_screen_tizen.cc',
+ 'runtime/browser/ui/splash_screen_tizen.h',
'runtime/browser/ui/taskbar_util.h',
'runtime/browser/ui/taskbar_util_win.cc',
'runtime/browser/ui/top_view_layout_views.cc',
'conditions': [
['tizen==1', {
'dependencies': [
+ '../content/content_resources.gyp:content_resources',
'build/system.gyp:tizen_geolocation',
'sysapps/sysapps_resources.gyp:xwalk_sysapps_resources',
'tizen/xwalk_tizen.gypi:xwalk_tizen_lib',
],
},
}],
+ [ 'tizen==1', {
+ 'variables': {
+ 'pak_inputs+': [
+ # Add WebUI resources for Tizen.
+ '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
+ '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
+ ],
+ },
+ }],
],
'inputs': [
'<(repack_path)',