Upstream version 7.36.151.0 26/22726/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Tue, 10 Jun 2014 09:14:43 +0000 (09:14 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Tue, 10 Jun 2014 09:14:43 +0000 (09:14 +0000)
Upstream commit-id 99d93deeba21f67b6eeec4aea675b1d5fd4c3e33

Change-Id: I60442d21a6ad20773c5ba5feda4e78d2d66ca8c9
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
17 files changed:
packaging/crosswalk.spec
src/xwalk/VERSION
src/xwalk/app/tools/android/customize_launch_screen.py
src/xwalk/application/browser/application.cc
src/xwalk/application/browser/application.h
src/xwalk/application/common/application_data.cc
src/xwalk/application/common/application_data.h
src/xwalk/application/common/application_manifest_constants.cc
src/xwalk/application/common/application_manifest_constants.h
src/xwalk/experimental/native_file_system/native_file_system_api_browsertest.cc
src/xwalk/experimental/native_file_system/native_file_system_extension.h
src/xwalk/experimental/native_file_system/virtual_root_provider_mac.cc [new file with mode: 0644]
src/xwalk/gyp_xwalk
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkNavigationHistory.java
src/xwalk/runtime/app/android/xwalk_main_delegate_android.cc
src/xwalk/xwalk.gyp

index 2e270d4..4f8ec3c 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.36.149.0
+Version:        7.36.151.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index e5e103f..02a90a2 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=7
 MINOR=36
-BUILD=149
+BUILD=151
 PATCH=0
index 4626b77..fcfd4c0 100755 (executable)
@@ -164,7 +164,7 @@ def CustomizeLaunchScreen(app_manifest, sanitized_name):
   if not app_manifest:
     return False
   parser = ManifestJsonParser(os.path.expanduser(app_manifest))
-  app_root = os.path.dirname(app_manifest)
+  app_root = os.path.dirname(parser.input_path)
   default = CustomizeByOrientation(parser, 'default',
                                    sanitized_name, app_root)
   portrait = CustomizeByOrientation(parser, 'portrait',
index 8e45647..8f1aad2 100644 (file)
@@ -11,6 +11,8 @@
 #include "base/macros.h"
 #include "base/message_loop/message_loop.h"
 #include "base/stl_util.h"
+#include "base/strings/string_split.h"
+#include "base/threading/thread_restrictions.h"
 #include "base/values.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/render_process_host.h"
@@ -91,7 +93,10 @@ bool Application::Launch(const LaunchParams& launch_params) {
 
   NativeAppWindow::CreateParams params;
   params.net_wm_pid = launch_params.launcher_pid;
-  params.state = GetWindowShowState(launch_params);
+  if (data_->GetPackageType() == Package::WGT)
+    params.state = GetWindowShowStateWGT(launch_params);
+  else
+    params.state = GetWindowShowStateXPK(launch_params);
   runtime->AttachWindow(params);
 
   return true;
@@ -128,7 +133,27 @@ GURL Application::GetStartURL(const LaunchParams& params,
   return GURL();
 }
 
-ui::WindowShowState Application::GetWindowShowState(
+ui::WindowShowState Application::GetWindowShowStateWGT(
+    const LaunchParams& params) {
+  if (params.force_fullscreen)
+    return ui::SHOW_STATE_FULLSCREEN;
+
+  const Manifest* manifest = data_->GetManifest();
+  std::string view_modes_string;
+  if (manifest->GetString(widget_keys::kViewModesKey, &view_modes_string)) {
+    // FIXME: ATM only 'fullscreen' and 'windowed' values are supported.
+    // If the first user prefererence is 'fullscreen', set window show state
+    // FULLSCREEN, otherwise set the default window show state.
+    std::vector<std::string> modes;
+    base::SplitString(view_modes_string, ' ', &modes);
+    if (!modes.empty() && modes[0] == "fullscreen")
+      return ui::SHOW_STATE_FULLSCREEN;
+  }
+
+  return ui::SHOW_STATE_DEFAULT;
+}
+
+ui::WindowShowState Application::GetWindowShowStateXPK(
     const LaunchParams& params) {
   if (params.force_fullscreen)
     return ui::SHOW_STATE_FULLSCREEN;
@@ -296,7 +321,7 @@ std::string Application::GetRegisteredPermissionName(
 }
 
 StoredPermission Application::GetPermission(PermissionType type,
-                               std::string& permission_name) const {
+                               const std::string& permission_name) const {
   if (type == SESSION_PERMISSION) {
     StoredPermissionMap::const_iterator iter =
         permission_map_.find(permission_name);
index 9ea52cc..8baa074 100644 (file)
@@ -115,7 +115,7 @@ class Application : public Runtime::Observer,
                                           const std::string& api_name) const;
 
   StoredPermission GetPermission(PermissionType type,
-                                 std::string& permission_name) const;
+                                 const std::string& permission_name) const;
   bool SetPermission(PermissionType type,
                      const std::string& permission_name,
                      StoredPermission perm);
@@ -156,7 +156,8 @@ class Application : public Runtime::Observer,
   // Try to extract the URL from different possible keys for entry points in the
   // manifest, returns it and the entry point used.
   GURL GetStartURL(const LaunchParams& params, LaunchEntryPoint* used);
-  ui::WindowShowState GetWindowShowState(const LaunchParams& params);
+  ui::WindowShowState GetWindowShowStateWGT(const LaunchParams& params);
+  ui::WindowShowState GetWindowShowStateXPK(const LaunchParams& params);
 
   GURL GetURLFromURLKey();
 
index fbe69fb..bf54bc1 100644 (file)
@@ -324,7 +324,7 @@ const std::set<std::string>& ApplicationData::GetEvents() const {
 }
 
 StoredPermission ApplicationData::GetPermission(
-    std::string& permission_name) const {
+    const std::string& permission_name) const {
   StoredPermissionMap::const_iterator iter =
       permission_map_.find(permission_name);
   if (iter == permission_map_.end())
index e00216a..b9063f5 100644 (file)
@@ -125,7 +125,7 @@ class ApplicationData : public base::RefCountedThreadSafe<ApplicationData> {
 
   // Permission related.
   StoredPermission GetPermission(
-      std::string& permission_name) const;
+      const std::string& permission_name) const;
   bool SetPermission(const std::string& permission_name,
                      StoredPermission perm);
   void ClearPermissions();
index 5419345..baed924 100644 (file)
@@ -47,6 +47,7 @@ const char kXmlLangKey[] = "@lang";
 const char kDefaultLocaleKey[] = "widget.@defaultlocale";
 const char kNameKey[] = "widget.name.#text";
 const char kVersionKey[] = "widget.@version";
+const char kViewModesKey[] = "widget.@viewmodes";
 const char kWidgetKey[] = "widget";
 const char kLaunchLocalPathKey[] = "widget.content.@src";
 const char kWebURLsKey[] = "widget.@id";
index 839e2c2..ab5ff07 100644 (file)
@@ -47,6 +47,7 @@ namespace application_widget_keys {
   extern const char kWebURLsKey[];
   extern const char kWidgetKey[];
   extern const char kVersionKey[];
+  extern const char kViewModesKey[];
   extern const char kAccessKey[];
   extern const char kAccessOriginKey[];
   extern const char kAccessSubdomainsKey[];
index 0ec31c2..56b80bd 100644 (file)
@@ -20,9 +20,11 @@ IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, NativeFileSystem) {
   content::TitleWatcher title_watcher(runtime()->web_contents(), passString);
   title_watcher.AlsoWaitForTitle(failString);
 
+#if defined(OS_LINUX)
   // create "<tmp>/Documents" path if not exists. This path will be used in this
   // testing to replace real home directory.
   VirtualRootProvider::SetTesting(true);
+#endif
 
   base::FilePath test_file;
   PathService::Get(base::DIR_SOURCE_ROOT, &test_file);
index 64293de..a7170fc 100644 (file)
@@ -56,6 +56,8 @@ class FileSystemChecker
   void DoTask();
 
  private:
+  friend class base::RefCountedThreadSafe<FileSystemChecker>;
+  virtual ~FileSystemChecker() {}
   void RegisterFileSystemsAndSendResponse();
 
   int process_id_;
diff --git a/src/xwalk/experimental/native_file_system/virtual_root_provider_mac.cc b/src/xwalk/experimental/native_file_system/virtual_root_provider_mac.cc
new file mode 100644 (file)
index 0000000..77ff994
--- /dev/null
@@ -0,0 +1,12 @@
+// 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.
+
+#include "xwalk/experimental/native_file_system/virtual_root_provider.h"
+
+#include "base/logging.h"
+
+VirtualRootProvider::VirtualRootProvider() {
+  // TODO(darktears): Mac support to be added.
+  NOTIMPLEMENTED();
+}
index 4868064..d4a7358 100755 (executable)
@@ -320,8 +320,8 @@ if __name__ == '__main__':
   if gyp_vars_dict.get('OS') == 'android':
     args.append('-Duse_openmax_dl_fft=1')
 
-  # Enable Aura by default on all platforms except Android
-  if gyp_vars_dict.get('OS') != 'android' and gyp_vars_dict.get('OS') != 'mac':
+  # Enable Aura by default on all platforms except Android and Mac.
+  if gyp_vars_dict.get('OS') != 'android' and sys.platform not in ('darwin',):
     args.append('-Duse_aura=1')
 
   if gyp_vars_dict.get('OS') == 'android':
index 2e270d4..4f8ec3c 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.36.149.0
+Version:        7.36.151.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index 8802288..47582fc 100644 (file)
@@ -49,6 +49,7 @@ public final class XWalkNavigationHistory implements Cloneable, Serializable {
      * @return the navigation item for the given index.
      */
     public XWalkNavigationItem getItemAt(int index) {
+        if (index < 0 || index >= size()) return null;
         return new XWalkNavigationItem(mHistory.getEntryAtIndex(index));
     }
 
index 7fa476e..13286e4 100644 (file)
@@ -7,6 +7,7 @@
 #include <string>
 
 #include "base/command_line.h"
+#include "base/cpu.h"
 #include "base/file_util.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
@@ -37,6 +38,11 @@ bool XWalkMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
 }
 
 void XWalkMainDelegateAndroid::PreSandboxStartup() {
+#if defined(ARCH_CPU_ARM_FAMILY)
+  // Create an instance of the CPU class to parse /proc/cpuinfo and cache
+  // cpu_brand info for ARM platform.
+  base::CPU cpu_info;
+#endif
   InitResourceBundle();
 }
 
index 475eb9b..c2d9dd0 100644 (file)
@@ -75,6 +75,7 @@
         '../extensions/common/url_pattern.h',
         'experimental/native_file_system/native_file_system_extension.cc',
         'experimental/native_file_system/native_file_system_extension.h',
+        'experimental/native_file_system/virtual_root_provider_mac.cc',
         'experimental/native_file_system/virtual_root_provider.cc',
         'experimental/native_file_system/virtual_root_provider.h',
         'runtime/app/android/xwalk_main_delegate_android.cc',