Make text selection feature available on desktop builds.
authorAntonio Gomes <a1.gomes@samsung.com>
Fri, 24 Jul 2015 20:31:36 +0000 (16:31 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
In GBS builds, we pass edje_dir value used to specify EDJ
resources' location as a GYP parameter (see -Dedje_dir in
chromium-efl.spec, for instance).

In order to have text selection on desktop builds, patch
does the same from build/common.sh.
Also, it makes GBS and desktop builds to take the same
codepath when resolving the respective edj path, eliminating
Reviewed by: Janusz Majnert, SeungSeop Park

Change-Id: Ia00bef1690f97ea77ff763718e6b36b6534fd9d0
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/build/common.sh
tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc
tizen_src/chromium_impl/content/common/paths_efl.cc

index a22fe68..39fbca8 100755 (executable)
@@ -129,7 +129,11 @@ function hostGypChromiumEfl() {
     if [[ $COMPONENT_BUILD == 1 ]]; then
       COMPONENT_ARG="-Dcomponent=shared_library"
     fi
-    ${TOPDIR}/tizen_src/build/gyp_chromiumefl.sh $XWALK_ARG $COMPONENT_ARG $@
+    ${TOPDIR}/tizen_src/build/gyp_chromiumefl.sh \
+      $XWALK_ARG \
+      $COMPONENT_ARG \
+      -Dedje_dir="out.$(getHostArch)/${BUILD_SUBDIRECTORY}/resources" \
+      $@
   fi
 }
 
index 4080e2c..a07dbf1 100644 (file)
@@ -9,8 +9,10 @@
 #include <Elementary.h>
 
 #include "base/files/file_path.h"
+#include "base/path_service.h"
 #include "base/trace_event/trace_event.h"
 #include "content/browser/selection/selection_controller_efl.h"
+#include "content/common/paths_efl.h"
 
 namespace content {
 
@@ -45,9 +47,13 @@ SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, Handl
   Evas* evas = evas_object_evas_get(parent);
   handle_ = edje_object_add(evas);
 
-  const char* theme_path = FILE_PATH_LITERAL("/usr/share/chromium-efl/themes/SelectionHandles.edj");
-  const char* group = GetEdjeObjectGroupPath(type);
+  base::FilePath edj_dir;
+  PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir);
+  base::FilePath selection_handles_edj =
+      edj_dir.Append(FILE_PATH_LITERAL("SelectionHandles.edj"));
 
+  const char* theme_path = selection_handles_edj.AsUTF8Unsafe().c_str();
+  const char* group = GetEdjeObjectGroupPath(type);
   if (edje_file_group_exists(theme_path, group)) {
     edje_object_file_set(handle_, theme_path, group);
   }
index 49651b4..ad5dfb2 100644 (file)
@@ -22,7 +22,6 @@ namespace {
 const base::FilePath::CharType kDataPath[] = FILE_PATH_LITERAL(DATA_DIR);
 const base::FilePath::CharType kExePath[] = FILE_PATH_LITERAL(EXE_DIR);
 const base::FilePath::CharType kLocalePath[] = FILE_PATH_LITERAL(LOCALE_DIR);
-const base::FilePath::CharType kEdjeThemesDir[] = FILE_PATH_LITERAL("themes");
 const base::FilePath::CharType kApplicationDataDir[] = FILE_PATH_LITERAL("data");
 const base::FilePath::CharType kApplicationCacheDir[] = FILE_PATH_LITERAL("cache");
 #if defined(TIZEN_V_3_0)
@@ -33,11 +32,11 @@ const base::FilePath::CharType kDownloadsDir[] = FILE_PATH_LITERAL("/opt/usr/med
 const base::FilePath::CharType kImagesDir[] = FILE_PATH_LITERAL("/opt/usr/media/Images/");
 #endif // TIZEN_V_3_0
 #else
-const base::FilePath::CharType kEdjeThemesDir[] = FILE_PATH_LITERAL("resources");
 const base::FilePath::CharType kLocaleDir[] = FILE_PATH_LITERAL("locale");
 const base::FilePath::CharType kDownloadsDir[] = FILE_PATH_LITERAL("/tmp/");
 const base::FilePath::CharType kImagesDir[] = FILE_PATH_LITERAL("/tmp/");
 #endif
+const base::FilePath::CharType kEdjePath[] = FILE_PATH_LITERAL(EDJE_DIR);
 const base::FilePath::CharType kApplicationName[] = FILE_PATH_LITERAL("chromium-efl");
 const base::FilePath::CharType kApplicationDataBaseDir[] = FILE_PATH_LITERAL("db");
 
@@ -156,19 +155,15 @@ bool PathProvider(int key, base::FilePath* result) {
     case DIR_LOCALE:
       *result = base::FilePath(kLocalePath);
       return true;
-    case EDJE_RESOURCE_DIR:
-      *result = base::FilePath(kDataPath).Append(kEdjeThemesDir);
-      return true;
 #else
     case DIR_LOCALE:
       PathService::Get(base::DIR_MODULE, result);
       *result = result->Append(kLocaleDir);
       return true;
+#endif
     case EDJE_RESOURCE_DIR:
-      PathService::Get(base::DIR_MODULE, result);
-      *result = result->Append(kEdjeThemesDir);
+      *result = base::FilePath(kEdjePath);
       return true;
-#endif
     case DIR_DOWNLOADS:
       *result = base::FilePath(kDownloadsDir);
       return true;