[M67 Dev][Tizen] Provide target profile information at runtime 69/185969/5
authorYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 14 Nov 2016 07:20:24 +0000 (16:20 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 7 Aug 2018 08:17:16 +0000 (01:17 -0700)
1. Regarding c++/header files

Replace the OS_TIZEN_<<PROFILE>> flag with Runtime flag as below.
Also, target profile information is provided at runtime
by using the 'system_info_get_platform_string' API.

[Before] : Using OS_TIZEN_<<PROFILE>> flag
==============================================================
// Implementation
==============================================================

[After] : Using Is<<PROFILE>>Profile() API
==============================================================

if (Is<<PROFILE>>Profile()) {
// Implementation
}
==============================================================

2. Regarding spec file

Remove the unnecessary package dependency and unify the
package dependency.

3. Regarding gn files

Remove the building_for_tizen_<<PROFILE>> flags.

4. Regarding is_tizen

Replace duplicated flag building_for_tizen with is_tizen.

Reference:
https://review.tizen.org/gerrit/#/c/171789/
https://review.tizen.org/gerrit/#/c/133971/

Change-Id: I24bfa39ac596fe8dc0dfffb3cc2ff503605b8cdd
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
64 files changed:
content/browser/BUILD.gn
content/common/BUILD.gn
content/public/common/web_preferences.cc
content/renderer/BUILD.gn
content/renderer/render_view_impl.cc
packaging/chromium-efl.spec
tizen_src/build/BUILD.gn
tizen_src/build/config/BUILD.gn
tizen_src/build/config/tizen_features.gni
tizen_src/build/gn_chromiumefl.sh
tizen_src/chromium_impl/content/browser/browser_efl.gni
tizen_src/chromium_impl/content/browser/device_sensors/data_fetcher_shared_memory_tizen.cc
tizen_src/chromium_impl/content/browser/media/efl/browser_media_player_manager_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/disambiguation_popup_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc
tizen_src/chromium_impl/content/common/BUILD.gn
tizen_src/chromium_impl/content/common/common_efl.gni
tizen_src/chromium_impl/content/content_efl.gni
tizen_src/chromium_impl/content/renderer/renderer_efl.gni
tizen_src/chromium_impl/efl/init.cc
tizen_src/chromium_impl/media/base/efl/media_player_efl.cc
tizen_src/chromium_impl/media/base/efl/media_player_util_efl.cc
tizen_src/chromium_impl/media/base/efl/media_player_util_efl.h
tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc
tizen_src/chromium_impl/media/base/tizen/media_source_player_capi.cc
tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_factory_tizen.cc
tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc
tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.h
tizen_src/chromium_impl/media/media_efl.gni
tizen_src/chromium_impl/tizen/BUILD.gn [new file with mode: 0644]
tizen_src/chromium_impl/tizen/system_info.cc [new file with mode: 0644]
tizen_src/chromium_impl/tizen/system_info.h [new file with mode: 0644]
tizen_src/chromium_impl/ui/display/device_display_info_efl.cc
tizen_src/chromium_impl/ui/gl/efl_pixmap.cc
tizen_src/chromium_impl/ui/ui_efl.gni
tizen_src/ewk/efl_integration/BUILD.gn
tizen_src/ewk/efl_integration/autofill_popup_view_efl.cc
tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc
tizen_src/ewk/efl_integration/browser/inputpicker/InputPicker.cc
tizen_src/ewk/efl_integration/browser/web_view_evas_handler.cc
tizen_src/ewk/efl_integration/command_line_efl.cc
tizen_src/ewk/efl_integration/common/content_switches_efl.h
tizen_src/ewk/efl_integration/common/version_info.cc
tizen_src/ewk/efl_integration/common/web_preferences_efl.h
tizen_src/ewk/efl_integration/context_menu_controller_efl.cc
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/eweb_view_callbacks.h
tizen_src/ewk/efl_integration/private/ewk_settings_private.h
tizen_src/ewk/efl_integration/public/ewk_application_cache_manager.cc
tizen_src/ewk/efl_integration/public/ewk_auth_request.cc
tizen_src/ewk/efl_integration/public/ewk_settings.cc
tizen_src/ewk/efl_integration/public/ewk_view.cc
tizen_src/ewk/efl_webview_app/BUILD.gn
tizen_src/ewk/efl_webview_app/app.c
tizen_src/ewk/efl_webview_app/mini_browser.c
tizen_src/ewk/tizen_version_defines_for_apps.gni
tizen_src/ewk/ubrowser/BUILD.gn
tizen_src/ewk/ubrowser/browser.cc
tizen_src/ewk/ubrowser/browser.h
tizen_src/ewk/ubrowser/window_ui.cc
tizen_src/ewk/unittest/BUILD.gn

index 098923d..2a1e579 100644 (file)
@@ -2395,7 +2395,7 @@ jumbo_source_set("browser") {
 
   if (use_efl) {
     sources += external_content_browser_efl_sources
-    if (building_for_tizen_mobile) {
+    if (is_tizen) {
       sources -= external_exclude_content_browser_efl_sources
     }
   }
index 7d0925c..8af23f3 100644 (file)
@@ -408,6 +408,10 @@ source_set("common") {
     "//url/ipc:url_ipc",
   ]
 
+  if (use_efl) {
+    deps += external_content_common_efl_deps
+  }
+
   defines = []
   include_dirs = []
   libs = []
index 6420357..5c5817d 100644 (file)
@@ -9,6 +9,10 @@
 #include "build/build_config.h"
 #include "third_party/blink/public/web/web_settings.h"
 
+#if defined(USE_EFL)
+#include "tizen/system_info.h"
+#endif
+
 using blink::WebSettings;
 
 namespace content {
@@ -241,6 +245,24 @@ WebPreferences::WebPreferences()
   fantasy_font_family_map[kCommonScript] = base::ASCIIToUTF16("Impact");
   pictograph_font_family_map[kCommonScript] =
       base::ASCIIToUTF16("Times New Roman");
+
+#if defined(USE_EFL)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    viewport_meta_enabled = true;
+    shrinks_viewport_contents_to_fit = true;
+    viewport_style = ViewportStyle::MOBILE;
+    always_show_context_menu_on_touch = false;
+    default_minimum_page_scale_factor = 0.25f;
+    default_maximum_page_scale_factor = 5.f;
+  } else {
+    viewport_meta_enabled = false;
+    shrinks_viewport_contents_to_fit = false;
+    viewport_style = ViewportStyle::DEFAULT;
+    always_show_context_menu_on_touch = true;
+    default_minimum_page_scale_factor = 1.f;
+    default_maximum_page_scale_factor = 4.f;
+  }
+#endif
 }
 
 WebPreferences::WebPreferences(const WebPreferences& other) = default;
index c3357c8..5088af0 100644 (file)
@@ -1091,7 +1091,7 @@ target(link_target_type, "renderer") {
       "//third_party/opus",
     ]
 
-    if (building_for_tizen) {
+    if (is_tizen) {
       sources -= [
         "pepper/video_decoder_shim.cc",
         "pepper/video_decoder_shim.h",
index 58cf6da..67f3251 100644 (file)
 #include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
 #endif
 
+#if defined(USE_EFL)
+#include "tizen/system_info.h"
+#endif  // USE_EFL
+
 using blink::WebAXObject;
 using blink::WebApplicationCacheHost;
 using blink::WebApplicationCacheHostClient;
index 30fbaa8..e609acc 100644 (file)
@@ -73,6 +73,7 @@ BuildRequires: pkgconfig(capi-media-player)
 BuildRequires: pkgconfig(capi-media-tool)
 BuildRequires: pkgconfig(capi-system-device)
 BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(capi-system-sensor)
 BuildRequires: pkgconfig(capi-system-system-settings)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(ecore)
@@ -151,21 +152,6 @@ BuildRequires: binutils-gold
 %endif
 %endif
 
-# Version Conditions for Each Targets
-%if "%{?chromium_efl_tizen_profile}%{!?chromium_efl_tizen_profile:0}" == "mobile"
-BuildRequires: bzip2-devel
-BuildRequires: pkgconfig(capi-system-sensor)
-%if "%{?_with_wayland}" != "1"
-BuildRequires: pkgconfig(xdamage)
-%endif
-%if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "2.4"
-BuildRequires: pkgconfig(ttrace)
-%endif
-%else # for TV
-BuildRequires: pkgconfig(audio-session-mgr)
-BuildRequires: pkgconfig(mm-session)
-%endif
-
 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "2.4"
 BuildRequires: pkgconfig(glesv2)
 %endif
@@ -301,13 +287,11 @@ fi
 
 #gn generate
 #run standard gn_chromiumefl wrapper
-   ./tizen_src/build/gn_chromiumefl.sh \
-  "building_for_tizen_%{OUTPUT_BUILD_PROFILE_TARGET}=true" \
+./tizen_src/build/gn_chromiumefl.sh \
   "data_dir=\"%{CHROMIUM_DATA_DIR}\"" \
   "edje_dir=\"%{CHROMIUM_DATA_DIR}/themes\"" \
   "exe_dir=\"%{CHROMIUM_EXE_DIR}\"" \
   "locale_dir=\"%{CHROMIUM_LOCALE_DIR}\"" \
-  "tizen_%{OUTPUT_BUILD_PROFILE_TARGET}=true" \
 %if 0%{?_remove_webcore_debug_symbols:1}
   "remove_webcore_debug_symbols=true" \
 %endif
@@ -323,6 +307,7 @@ fi
 %if 0%{?component_build}
  "component=\"shared_library\"" \
 %endif
+  "is_tizen=true"
 
 ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" \
 %if 0%{?_enable_content_shell}
index 66a61bb..ea637eb 100644 (file)
@@ -56,20 +56,20 @@ config("ecore-x-public") {
 }
 
 config("ecore-wayland") {
-  if (building_for_tizen && use_wayland) {
+  if (is_tizen && use_wayland) {
     ldflags = [ "-lecore_wayland" ]
   }
 }
 
 tizen_pkg_config("libecore-wayland") {
   packages = []
-  if (building_for_tizen && use_wayland) {
+  if (is_tizen && use_wayland) {
     packages = [ "ecore-wayland" ]
   }
 }
 
 config("ecore-wayland-public") {
-  if (building_for_tizen && use_wayland) {
+  if (is_tizen && use_wayland) {
     cflags = [ "-ecore-wayland" ]
   }
 }
@@ -132,210 +132,210 @@ config("edje-public") {
 }
 
 config("efl-extension") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lefl-extension" ]
   }
 }
 
 tizen_pkg_config("libefl-extension") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "efl-extension" ]
   }
 }
 
 config("efl-extension-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-efl-extension" ]
   }
 }
 
 config("ui-gadget") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lui-gadget-1" ]
   }
 }
 
 tizen_pkg_config("libui-gadget") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "ui-gadget-1" ]
   }
 }
 
 config("ui-gadget-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-DUG_WAYLAND" ]
   }
 }
 
 config("capi-appfw-application") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-appfw-application" ]
   }
 }
 
 tizen_pkg_config("libcapi-appfw-application") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-appfw-application" ]
   }
 }
 
 config("capi-appfw-application-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #    cflags = [ "-capi-appfw-application" ]
   }
 }
 
 config("capi-location-manager") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-location-manager" ]
   }
 }
 
 tizen_pkg_config("libcapi-location-manager") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-location-manager" ]
   }
 }
 
 config("capi-location-manager-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #cflags = [ "-capi-location-manager" ]
   }
 }
 
 config("capi-system-info") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-system-info" ]
   }
 }
 
 tizen_pkg_config("libcapi-system-info") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-system-info" ]
   }
 }
 
 config("capi-system-info-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #cflags = [ "-capi-system-info" ]
   }
 }
 
 config("capi-system-device") {
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-system-device" ]
   }
 }
 
 tizen_pkg_config("libcapi-system-device") {
   packages = []
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     packages = [ "capi-system-device" ]
   }
 }
 
 config("capi-system-device-public") {
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     #cflags = [ "-capi-system-device" ]
   }
 }
 
 config("capi-system-sensor") {
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     #ldflags = [ "-capi-system-sensor" ]
   }
 }
 
 tizen_pkg_config("libcapi-system-sensor") {
   packages = []
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     packages = [ "capi-system-sensor" ]
   }
 }
 
 config("capi-system-sensor-public") {
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     cflags = [ "-capi-system-sensor" ]
   }
 }
 
 config("capi-system-system-settings") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-system-system-settings" ]
   }
 }
 
 tizen_pkg_config("libcapi-system-system-settings") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-system-system-settings" ]
   }
 }
 
 config("capi-system-system-settings-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-capi-system-system-settings" ]
   }
 }
 
 config("libdri2") {
-  if (building_for_tizen && !use_wayland) {
+  if (is_tizen && !use_wayland) {
     ldflags = [ "-llibdri2" ]
   }
 }
 
 tizen_pkg_config("liblibdri2") {
   packages = []
-  if (building_for_tizen && !use_wayland) {
+  if (is_tizen && !use_wayland) {
     packages = [ "libdri2" ]
   }
 }
 
 config("libdri2-public") {
-  if (building_for_tizen && !use_wayland) {
+  if (is_tizen && !use_wayland) {
     cflags = [ "-libdri2" ]
   }
 }
 
 config("libdrm") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-llibdrm" ]
   }
 }
 
 tizen_pkg_config("liblibdrm") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "libdrm" ]
   }
 }
 
 config("libdrm-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-libdrm" ]
   }
 }
 
 config("libtbm") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-llibtbm" ]
   }
 }
 
 tizen_pkg_config("liblibtbm") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "libtbm" ]
   }
 }
 
 config("libtbm-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-libtbm" ]
   }
 }
@@ -418,153 +418,153 @@ config("gstreamer-fft-public") {
 }
 
 config("capi-media-camera") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #ldflags = [ "-capi-media-camera" ]
   }
 }
 
 tizen_pkg_config("libcapi-media-camera") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-media-camera" ]
   }
 }
 
 config("capi-media-camera-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #cflags = [ "-capi-media-camera" ]
   }
 }
 
 config("capi-media-audio-io") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-media-audio-io" ]
   }
 }
 
 tizen_pkg_config("libcapi-media-audio-io") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-media-audio-io" ]
   }
 }
 
 config("capi-media-audio-io-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-capi-media-audio-io" ]
   }
 }
 
 config("capi-media-player") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #ldflags = [ "-capi-media-player" ]
   }
 }
 
 tizen_pkg_config("libcapi-media-player") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-media-player" ]
   }
 }
 
 config("capi-media-player-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-capi-media-player" ]
   }
 }
 
 config("capi-media-tool") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lcapi-media-tool" ]
   }
 }
 
 tizen_pkg_config("libcapi-media-tool") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "capi-media-tool" ]
   }
 }
 
 config("capi-media-tool-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-capi-media-tool" ]
   }
 }
 
 config("mm-player") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lmm-player" ]
   }
 }
 
 tizen_pkg_config("libmm-player") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "mm-player" ]
   }
 }
 
 config("mm-player-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-mm-player" ]
   }
 }
 
 config("tts") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-ltts" ]
   }
 }
 
 tizen_pkg_config("libtts") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "tts" ]
   }
 }
 
 config("tts-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags = [ "-tts" ]
   }
 }
 
 config("vconf") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lvconf" ]
   }
 }
 
 tizen_pkg_config("libvconf") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "vconf" ]
   }
 }
 
 config("vconf-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #cflags = [ "-vconf" ]
   }
 }
 
 config("feedback") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     ldflags = [ "-lfeedback" ]
   }
 }
 
 tizen_pkg_config("libfeedback") {
   packages = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     packages = [ "feedback" ]
   }
 }
 
 config("feedback-public") {
-  if (building_for_tizen) {
+  if (is_tizen) {
     #cflags = [ "-feedback" ]
   }
 }
index fdb0c82..44b7af2 100644 (file)
@@ -55,7 +55,7 @@ config("tizen_feature_flags") {
     }
   }
 
-  if (building_for_tizen) {
+  if (is_tizen) {
     defines += [
       "OS_TIZEN",
       "WTF_OS_TIZEN",
@@ -108,25 +108,4 @@ config("tizen_feature_flags") {
     }
   }
 
-  if (building_for_tizen_mobile) {
-    defines += [
-      "OS_TIZEN_MOBILE",
-      "WTF_OS_TIZEN_MOBILE",
-      "TIZEN_CONTENTS_DETECTION",
-    ]
-  }
-
-  if (building_for_tizen_tv) {
-    defines += [
-      "OS_TIZEN_TV",
-      "WTF_OS_TIZEN_TV",
-    ]
-
-    if (chromium_efl_tizen_version == 24) {
-      cflags -= [
-        "-march=armv7-a",
-        "-mtune=generic-armv7-a",
-      ]
-    }
-  }
 }
index 8f6f7a1..0e0884a 100644 (file)
@@ -6,6 +6,7 @@ import("//build/config/ui.gni")
 
 declare_args() {
   gcc_version = 49
+  is_tizen = false
 
   use_wayland = false
 
@@ -28,10 +29,6 @@ declare_args() {
   # declared from BUILDCONFIG.gn
   #is_clang = false
 
-  tizen_mobile = false
-  building_for_tizen_tv = false
-  building_for_tizen_mobile = false
-
   exe_dir = "/usr/lib/chromium-efl/"
   edje_dir = "/usr/share/chromium-efl/themes/"
   tizen_data_dir = "/usr/share/chromium-efl/"
@@ -40,7 +37,6 @@ declare_args() {
   prebuilt_ld_gold_dir = ""
   chromium_efl_tizen_version = 24
   tizen_tbm_support = false
-  building_for_tizen = false
 }
 
 if (is_tizen && tizen_multimedia_support) {
index a5f2fb7..d4c6446 100755 (executable)
@@ -5,7 +5,7 @@ trap 'error_report $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
 host_arch=$(getHostArch)
 export HOST_ARCH=$host_arch
 
-supported_targets=("mobile" "tv" "desktop")
+supported_targets=("tizen" "desktop")
 
 if [ -z "$GN_GENERATOR_OUTPUT" ]; then
   GN_GENERATOR_OUTPUT="out.${host_arch}"
@@ -28,10 +28,9 @@ fi
 
 while [[ $# > 0 ]]; do
   case "$1" in
-    building_for_tizen_*=true)
+    is_tizen=true)
       buildType="gbs"
-      target=$(echo $1 | sed -e 's/building_for_tizen_\(.*\)=true/\1/')
-      target_arch="arm"
+      target="tizen"
       ;;
     chromium_efl_tizen_version=*)
       tizen_version=$(echo $1 | sed -e 's#chromium_efl_tizen_version\=\([0-9.]*\)#\1#')
@@ -93,9 +92,7 @@ add_desktop_flags() {
   if [ "$USECLANG" == "0" ]; then
     clang="false"
   fi
-  ADDITIONAL_GN_PARAMETERS+="building_for_tizen=false
-                             building_for_tizen_mobile=false
-                             building_for_tizen_tv=false
+  ADDITIONAL_GN_PARAMETERS+="is_tizen=false
                              is_clang=${clang}
                              werror=false
                              use_sysroot=false
@@ -111,7 +108,7 @@ add_arm_flags() {
 }
 
 add_tizen_flags() {
-  ADDITIONAL_GN_PARAMETERS+="building_for_tizen=true
+  ADDITIONAL_GN_PARAMETERS+="is_tizen=true
                              python_ver=\"$(getPythonVersion)\"
                              enable_basic_printing=true
                              is_clang=false
@@ -231,7 +228,7 @@ _GN_ARGS="
     $COMMON_GN_PARAMETERS
     $ADDITIONAL_GN_PARAMETERS
     $EXTRA_GN_ARGS
-    "
+"
 printf "GN_ARGUMENTS:\n"
 for arg in $_GN_ARGS; do
   printf "    * ${arg##-D}\n"
index 50c8f4e..a428609 100644 (file)
@@ -25,7 +25,7 @@ external_content_browser_efl_configs = [
   "//tizen_src/build:libtts",
 ]
 
-if (building_for_tizen) {
+if (is_tizen) {
   external_content_browser_efl_configs += [
     "//tizen_src/build:vconf",
     "//tizen_src/build:libvconf",
@@ -110,7 +110,7 @@ external_content_browser_efl_sources += [
   "//content/browser/renderer_host/ui_events_helper.h",
 ]
 
-if (building_for_tizen) {
+if (is_tizen) {
   external_exclude_content_browser_efl_sources = [ "//tizen_src/chromium_impl/content/browser/device_sensors/data_fetcher_shared_memory_tizen.cc" ]
 
   external_content_browser_efl_sources += [
index a839c9e..e58cb06 100644 (file)
@@ -2,13 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include "content/browser/device_sensors/data_fetcher_impl_tizen.h"
 #endif
+
 #include "base/logging.h"
 #include "content/browser/device_sensors/data_fetcher_shared_memory.h"
 #include "content/common/device_sensors/device_motion_hardware_buffer.h"
 #include "content/common/device_sensors/device_orientation_hardware_buffer.h"
+#include "tizen/system_info.h"
 
 namespace content {
 
@@ -19,7 +21,9 @@ DataFetcherSharedMemory::~DataFetcherSharedMemory() {
 }
 
 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
-#if defined(OS_TIZEN_MOBILE)
+  if (!(IsMobileProfile() || IsWearableProfile()))
+    return false;
+
   DCHECK(buffer);
 
   switch (consumer_type) {
@@ -34,12 +38,13 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
     default:
       NOTREACHED();
   }
-#endif // OS_TIZEN_MOBILE
   return false;
 }
 
 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
-#if defined(OS_TIZEN_MOBILE)
+  if (!(IsMobileProfile() || IsWearableProfile()))
+    return false;
+
   switch (consumer_type) {
     case CONSUMER_TYPE_MOTION:
       DataFetcherImplTizen::GetInstance()->StopFetchingDeviceMotionData();
@@ -50,7 +55,6 @@ bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
     default:
       NOTREACHED();
   }
-#endif // OS_TIZEN_MOBILE
   return false;
 }
 
index 04b1fbb..a0725f9 100644 (file)
@@ -13,6 +13,7 @@
 #include "ipc/ipc_channel_proxy.h"
 #include "ipc/ipc_logging.h"
 #include "media/base/efl/media_player_efl.h"
+#include "tizen/system_info.h"
 
 #if defined(TIZEN_TBM_SUPPORT)
 #include <media_packet.h>
 
 namespace content {
 
-#if defined(OS_TIZEN_TV)
-const int kMaximumPlayerCount = 1;
-#elif defined(OS_TIZEN_MOBILE)
-const int kMaximumPlayerCount = 5;
-#else
-const int kMaximumPlayerCount = 5;
-#endif
+static unsigned int GetMaximumPlayerCount() {
+  // Note : In case of Mobile , maximum decoder instance count is depending on
+  // contents resolution but to get the resolution of content, player should be
+  // prepared. Hence maximum instance count is set as 1.
+  // Resolution <= 720P : 2
+  // Resolution >  720P : 1
+  // Incase of TV : audio & video using H/W decoder , so only support 1.
+  if (IsTvProfile())
+    return 1;
+  else if (IsMobileProfile() || IsWearableProfile())
+    return 1;
+  else
+    return 5;
+}
 
 // GetContentClient() is defined in content_client.cc, but in content_client.h
 // it is hidden by CONTENT_IMPLEMENTATION ifdef. We don't want to define
@@ -81,7 +89,7 @@ void BrowserMediaPlayerManagerEfl::OnResumeComplete(int player_id) {
     }
   }
 
-  if (resumed_queue_.size() < kMaximumPlayerCount)
+  if (resumed_queue_.size() < GetMaximumPlayerCount())
     resumed_queue_.push_back(player_id);
 }
 
@@ -248,7 +256,7 @@ void BrowserMediaPlayerManagerEfl::OnDestroy(int player_id) {
 }
 
 void BrowserMediaPlayerManagerEfl::SuspendPlayers() {
-  while (resumed_queue_.size() >= kMaximumPlayerCount) {
+  while (resumed_queue_.size() >= GetMaximumPlayerCount()) {
     media::MediaPlayerEfl* player = GetPlayer(resumed_queue_.front());
     if (player)
       player->Suspend();
index 1021ba9..bf9b050 100644 (file)
 #include "content/browser/renderer_host/render_widget_host_view_efl.h"
 #include "content/browser/renderer_host/web_event_factory_efl.h"
 #include "content/common/paths_efl.h"
+#include "tizen/system_info.h"
 #include "ui/events/event.h"
 #include "ui/display/screen.h"
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include <efl_extension.h>
 #endif
 
 namespace content {
 
 namespace {
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 void DisambiguationPopupHWBackKey(void* data, Evas_Object* obj, void* event_info) {
-  DisambiguationPopupEfl* instance = static_cast<DisambiguationPopupEfl*>(data);
-  instance->Dismiss();
+  if (IsMobileProfile() || IsWearableProfile()) {
+    DisambiguationPopupEfl* instance = static_cast<DisambiguationPopupEfl*>(data);
+    instance->Dismiss();
+  }
 }
 #endif
 
@@ -107,9 +110,11 @@ void DisambiguationPopupEfl::Show(const gfx::Rect& target,
   evas_object_event_callback_add(popup_,
       EVAS_CALLBACK_MULTI_DOWN, TouchedOnOutterArea, this);
 
-#if defined(OS_TIZEN_MOBILE)
-  eext_object_event_callback_add(
-      popup_, EEXT_CALLBACK_BACK, DisambiguationPopupHWBackKey, this);
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    eext_object_event_callback_add(
+        popup_, EEXT_CALLBACK_BACK, DisambiguationPopupHWBackKey, this);
+  }
 #endif
 
   int parent_view_x = 0, parent_view_y = 0;
index 4388166..b828752 100644 (file)
@@ -46,6 +46,7 @@
 #include "third_party/blink/public/platform/web_input_event.h"
 #include "third_party/blink/public/platform/web_screen_info.h"
 #include "third_party/blink/public/platform/web_touch_point.h"
+#include "tizen/system_info.h"
 #include "ui/base/clipboard/clipboard_helper_efl.h"
 #include "ui/base/layout.h"
 #include "ui/events/blink/blink_event_util.h"
@@ -64,7 +65,7 @@
 #include "ui/gfx/selection_bound.h"
 #include "ui/gl/gl_shared_context_efl.h"
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include <efl_extension.h>
 #endif
 
@@ -129,16 +130,16 @@ void RenderWidgetHostViewBase::GetDefaultScreenInfo(
   results->availableRect = display.work_area();
   results->deviceScaleFactor = display.device_scale_factor();
   results->orientationAngle = display.RotationAsDegree();
-#if defined(OS_TIZEN_MOBILE)
-  results->orientationType =
-// RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
-#else
-  results->orientationType =
-// RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display);
-#endif
 
-      // TODO(derat|oshima): Don't hardcode this. Get this from display object.
-      results->depth = 24;
+  if (IsMobileProfile() || IsWearableProfile())
+    results->orientationType =
+        RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
+  else
+    results->orientationType =
+        RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display);
+
+  // TODO(derat|oshima): Don't hardcode this. Get this from display object.
+  results->depth = 24;
   results->depthPerComponent = 8;
 }
 #endif  // !defined(EWK_BRINGUP)
@@ -250,9 +251,11 @@ void RenderWidgetHostViewEfl::InitAsChild(gfx::NativeView parent_view) {
   evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MULTI_UP,
                                  OnMultiTouchUpEvent, this);
 
-#if defined(OS_TIZEN_MOBILE)
-  eext_object_event_callback_add(content_image_, EEXT_CALLBACK_BACK,
-                                 OnHWBackEvent, this);
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    eext_object_event_callback_add(content_image_, EEXT_CALLBACK_BACK,
+                                   OnHWBackEvent, this);
+  }
 #endif
 
   // IMContext calls evas() getter on 'this' so it needs to be
@@ -1211,12 +1214,14 @@ void RenderWidgetHostViewEfl::OnKeyUp(void* data,
       MakeWebKeyboardEvent(false, static_cast<Evas_Event_Key_Up*>(event_info)));
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 void RenderWidgetHostViewEfl::OnHWBackEvent(void* data,
                                             Evas_Object* obj,
                                             void* event_info) {
-  RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
-  rwhv->evas_event_handler_->HandleEvent_HWBack();
+  if (IsMobileProfile() || IsWearableProfile()) {
+    RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(data);
+    rwhv->evas_event_handler_->HandleEvent_HWBack();
+  }
 }
 #endif
 
@@ -1366,9 +1371,13 @@ void RenderWidgetHostViewEfl::HandleGesture(blink::WebGestureEvent& event) {
        event_type == blink::WebInputEvent::kGestureTapCancel) &&
       !handling_disambiguation_popup_gesture_) {
     float size = 32.0f;  // Default value
-#if defined(OS_TIZEN_MOBILE)
-    size = elm_config_finger_size_get() / device_scale_factor_;
+
+#if defined(OS_TIZEN)
+    if (IsMobileProfile() || IsWearableProfile()) {
+      size = elm_config_finger_size_get() / device_scale_factor_;
+    }
 #endif
+
     event.data.tap.width = size;
     event.data.tap.height = size;
   }
index 8a3848b..33c198c 100644 (file)
@@ -269,7 +269,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEfl
   static void OnMouseWheel(void* data, Evas*, Evas_Object*, void*);
   static void OnKeyDown(void*, Evas*, Evas_Object*, void*);
   static void OnKeyUp(void*, Evas*, Evas_Object*, void*);
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
   static void OnHWBackEvent(void*, Evas_Object*, void*);
 #endif
 
index ebe30d7..4291381 100644 (file)
@@ -20,6 +20,7 @@
 #include "content/public/browser/web_contents_view_delegate.h"
 #include "content/public/browser/web_contents_view_efl_delegate.h"
 #include "efl/window_factory.h"
+#include "tizen/system_info.h"
 #include "ui/display/screen_efl.h"
 #include "ui/events/event_switches.h"
 #include "ui/gfx/image/image_skia.h"
@@ -41,15 +42,8 @@ WebContentsViewEfl::WebContentsViewEfl(WebContents* contents,
     : delegate_(delegate),
       native_view_(NULL),
       drag_dest_delegate_(NULL),
-      orientation_(0)
-#if defined(OS_TIZEN_MOBILE)
-      ,
-      touch_enabled_(true)
-#else
-      ,
-      touch_enabled_(false)
-#endif
-      ,
+      orientation_(0),
+      touch_enabled_(IsMobileProfile() || IsWearableProfile()),
       page_scale_factor_(1.0f),
       web_contents_(contents) {
 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
index 7d3ab57..6da0aba 100644 (file)
@@ -12,7 +12,7 @@ config("content_common_efl") {
     "EXE_DIR=\"$exe_dir\"",
   ]
 
-  if (building_for_tizen) {
+  if (is_tizen) {
     defines += [
       "EDJE_DIR=\"$edje_dir\"",
       "LOCALE_DIR=\"$locale_dir\"",
index 1b8110b..702dd4a 100644 (file)
@@ -48,7 +48,10 @@ if (tizen_multimedia_support) {
 # Dependency
 ##############################################################################
 
-external_content_common_efl_deps = [ "//third_party/fontconfig" ]
+external_content_common_efl_deps = [
+  "//third_party/fontconfig",
+  "//tizen_src/chromium_impl/tizen:system-info",
+]
 
 ##############################################################################
 # Source
@@ -69,7 +72,7 @@ external_content_common_efl_sources = [
   "//tizen_src/chromium_impl/content/common/wrt/wrt_url_parse.h",
 ]
 
-if (building_for_tizen) {
+if (is_tizen) {
   external_content_common_efl_sources += [
     "//tizen_src/chromium_impl/content/common/tts_messages_efl.h",
     "//tizen_src/chromium_impl/content/common/tts_utterance_request_efl.cc",
@@ -77,7 +80,7 @@ if (building_for_tizen) {
   ]
 }
 
-if (building_for_tizen && !ewk_bringup) {
+if (is_tizen && !ewk_bringup) {
   external_content_common_efl_sources += [
     "//tizen_src/chromium_impl/content/common/gpu/client/gpu_memory_buffer_impl_efl.cc",
     "//tizen_src/chromium_impl/content/common/gpu/gpu_memory_buffer_factory_efl.cc",
index ddabf51..b622019 100644 (file)
@@ -69,7 +69,7 @@ external_content_shell_configs = [
 external_content_shell_deps = [ "//tizen_src/chromium_impl/efl:efl-init" ]
 external_content_shell_deps += js_dialog_efl_deps
 
-if (building_for_tizen) {
+if (is_tizen) {
   external_content_browser_configs += [
     "//tizen_src/build:vconf",
     "//tizen_src/build:libvconf",
index b82318f..1d51be7 100644 (file)
@@ -32,7 +32,7 @@ external_content_renderer_efl_deps =
 ##############################################################################
 external_content_renderer_efl_sources = []
 
-if (building_for_tizen) {
+if (is_tizen) {
   external_content_renderer_efl_sources += [
     "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.cc",
     "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.h",
index 3de2d2b..c5d2a44 100644 (file)
@@ -15,6 +15,7 @@
 #include "content/common/paths_efl.h"
 #include "content/public/common/content_switches.h"
 #include "gpu/config/gpu_switches.h"
+#include "tizen/system_info.h"
 #include "ui/compositor/compositor_switches.h"
 #include "ui/display/screen_efl.h"
 #include "ui/gfx/switches.h"
@@ -94,9 +95,9 @@ void AppendPortParams(base::CommandLine& cmdline) {
   cmdline.AppendSwitch(switches::kIgnoreGpuBlacklist);
 #endif
 
-#if defined(OS_TIZEN_TV)
-  cmdline.AppendSwitchASCII(switches::kAcceleratedCanvas2dMSAASampleCount, "4");
-#endif
+  if (IsTvProfile()) {
+    cmdline.AppendSwitchASCII(switches::kAcceleratedCanvas2dMSAASampleCount, "4");
+  }
 }
 
 }  // namespace efl
index 73ab6f6..8263549 100644 (file)
@@ -122,10 +122,7 @@ void MediaPlayerEfl::OnMediaError(MediaError err) {
   }
 
   manager()->OnNetworkStateChange(GetPlayerId(), state);
-
-#if defined(OS_TIZEN_MOBILE)
   ReleaseDisplayLock();
-#endif
 }
 
 }  // namespace media
index 9ee4542..d2052c0 100644 (file)
@@ -4,14 +4,11 @@
 
 #include "media/base/efl/media_player_util_efl.h"
 
-#include <player.h>
-
 #include "base/logging.h"
 #include "base/time/time.h"
 
-#if defined(OS_TIZEN_MOBILE)
 #include <device/power.h>
-#endif
+#include <player.h>
 
 namespace media {
 
@@ -114,8 +111,10 @@ GURL GetCleanURL(std::string url) {
   return url_;
 }
 
-#if defined(OS_TIZEN_MOBILE)
 void WakeUpDisplayAndAcquireDisplayLock() {
+  if (!IsMobileProfile() && !IsWearableProfile())
+    return;
+
   if (device_power_wakeup(false) != DEVICE_ERROR_NONE)
     LOG(ERROR) << "|device_power_wakeup| request failed";
   if (device_power_request_lock(POWER_LOCK_DISPLAY, 0) != DEVICE_ERROR_NONE)
@@ -123,9 +122,11 @@ void WakeUpDisplayAndAcquireDisplayLock() {
 }
 
 void ReleaseDisplayLock() {
+  if (!IsMobileProfile() && !IsWearableProfile())
+    return;
+
   if (device_power_release_lock(POWER_LOCK_DISPLAY) != DEVICE_ERROR_NONE)
     LOG(ERROR) << "|device_power_release_lock| request failed";
 }
-#endif
 
 }  // namespace media
index ce1dbbb..596ccb8 100644 (file)
@@ -42,10 +42,8 @@ double ConvertSecondsToMilliSeconds(double time);
 // Removes query string from URI.
 MEDIA_EXPORT GURL GetCleanURL(std::string url);
 
-#if defined(OS_TIZEN_MOBILE)
 void WakeUpDisplayAndAcquireDisplayLock();
 void ReleaseDisplayLock();
-#endif
 
 }  // namespace media
 
index 512ecd9..54c9f66 100644 (file)
@@ -276,9 +276,8 @@ void MediaPlayerBridgeCapi::Play() {
     return;
   }
 
-#if defined(OS_TIZEN_MOBILE)
   WakeUpDisplayAndAcquireDisplayLock();
-#endif
+
   StartCurrentTimeUpdateTimer();
   if (!is_file_url_)
     StartBufferingUpdateTimer();
@@ -300,10 +299,7 @@ void MediaPlayerBridgeCapi::Pause(bool /* is_media_related_action */) {
   if (!is_file_url_)
     StartBufferingUpdateTimer();
 
-#if defined(OS_TIZEN_MOBILE)
   ReleaseDisplayLock();
-#endif
-
   StopCurrentTimeUpdateTimer();
   is_paused_ = true;
 }
@@ -516,9 +512,7 @@ void MediaPlayerBridgeCapi::OnTimeChanged() {
 
 void MediaPlayerBridgeCapi::PlaybackCompleteUpdate() {
   is_end_reached_ = true;
-#if defined(OS_TIZEN_MOBILE)
   ReleaseDisplayLock();
-#endif
 
   StopCurrentTimeUpdateTimer();
   manager()->OnTimeUpdate(GetPlayerId(), GetCurrentTime());
index 06e69a5..059b7a1 100644 (file)
@@ -368,9 +368,8 @@ void MediaSourcePlayerCapi::Play() {
     return;
   }
 
-#if defined(OS_TIZEN_MOBILE)
   WakeUpDisplayAndAcquireDisplayLock();
-#endif
+
   int ret = player_start(player_);
   if (ret != PLAYER_ERROR_NONE) {
     OnHandlePlayerError(ret, FROM_HERE);
@@ -396,9 +395,7 @@ void MediaSourcePlayerCapi::Pause(bool is_media_related_action) {
   }
   StopCurrentTimeUpdateTimer();
   if (!is_media_related_action) {
-#if defined(OS_TIZEN_MOBILE)
     ReleaseDisplayLock();
-#endif
   }
   playing_ = false;
 }
@@ -409,9 +406,7 @@ void MediaSourcePlayerCapi::PlaybackComplete() {
   StopCurrentTimeUpdateTimer();
   manager()->OnTimeUpdate(GetPlayerId(), time);
   manager()->OnTimeChanged(GetPlayerId());
-#if defined(OS_TIZEN_MOBILE)
   ReleaseDisplayLock();
-#endif
 }
 
 // TODO(sam) : It's worked as bypass now. Need Suspend/Resume/Initialize
index 9bdc675..8b9315b 100644 (file)
@@ -236,13 +236,13 @@ void VideoCaptureDeviceFactoryTizen::GetDeviceNames(
   }
   VideoCaptureDevice::Name primary_camera(
       VideoCaptureDeviceTizen::kFrontCameraName,
-      VideoCaptureDeviceTizen::kFrontCameraId);
+      VideoCaptureDeviceTizen::GetFrontCameraID());
 
   device_names->push_back(primary_camera);
   if (device_count == 2) {
     VideoCaptureDevice::Name secondary_camera(
         VideoCaptureDeviceTizen::kBackCameraName,
-        VideoCaptureDeviceTizen::kBackCameraId);
+        VideoCaptureDeviceTizen::GetBackCameraID());
     device_names->push_back(secondary_camera);
   }
 }
index da033ca..61ffa29 100644 (file)
@@ -4,16 +4,16 @@
 
 #include "media/capture/video/tizen/video_capture_device_tizen.h"
 
+#include "base/bind.h"
 #include "third_party/libyuv/include/libyuv.h"
+#include "tizen/profile_info.h"
+#include "ui/gfx/screen.h"
 
 #if defined(WEBRTC_DEBUG_DUMPFILE)
 #include <fcntl.h>
 #include <unistd.h>
 #endif
 
-#include "base/bind.h"
-#include "ui/gfx/screen.h"
-
 #if defined(WEBRTC_DEBUG_DUMPFILE)
 int fd_1 = -1;
 int fd_2 = -1;
@@ -126,37 +126,55 @@ bool OnPreviewFormat(
   return true;
 }
 
+struct CameraSpec {
+  const char* device_id_;
+  CameraOrientation orientation_;
+};
+
+const std::vector<CameraSpec>& GetCameraSpec() {
+  const static std::vector<CameraSpec> kMobileCameraSpecs = {
+      {media::VideoCaptureDeviceTizen::GetFrontCameraID().c_str(), DEGREE_270},
+      {media::VideoCaptureDeviceTizen::GetBackCameraID().c_str(), DEGREE_90}};
+
+  const static std::vector<CameraSpec> kCommonCameraSpecs = {
+      {media::VideoCaptureDeviceTizen::GetFrontCameraID().c_str(), DEGREE_0}};
+
+  if (IsMobileProfile() || IsWearableProfile())
+    return kMobileCameraSpecs;
+  else
+    return kCommonCameraSpecs;
+}
+
 } // unnamed namespace
 
 namespace media {
 
 const std::string VideoCaptureDeviceTizen::kFrontCameraName = "front";
 const std::string VideoCaptureDeviceTizen::kBackCameraName = "back";
-#if defined(OS_TIZEN_MOBILE)
-const std::string VideoCaptureDeviceTizen::kFrontCameraId = "1";
-const std::string VideoCaptureDeviceTizen::kBackCameraId = "0";
-#else
-const std::string VideoCaptureDeviceTizen::kBackCameraId = "1";
-const std::string VideoCaptureDeviceTizen::kFrontCameraId = "0";
-#endif
 
-struct CameraSpec {
-  const char* device_id_;
-  CameraOrientation orientation_;
-};
+const std::string VideoCaptureDeviceTizen::kCameraId0 = "0";
+const std::string VideoCaptureDeviceTizen::kCameraId1 = "1";
 
-const static CameraSpec kCameraSpecs[] = {
-#if defined(OS_TIZEN_MOBILE)
-    {VideoCaptureDeviceTizen::kBackCameraId.c_str(), DEGREE_90},
-    {VideoCaptureDeviceTizen::kFrontCameraId.c_str(), DEGREE_270}
-#else
-    {VideoCaptureDeviceTizen::kFrontCameraId.c_str(), DEGREE_0},
-#endif
-};
+// Note : Camera ID for Mobile or Wearable profile > Front : 1 / Back : 0
+const std::string VideoCaptureDeviceTizen::GetFrontCameraID() {
+  if (IsMobileProfile() || IsWearableProfile())
+    return VideoCaptureDeviceTizen::kCameraId1;
+  else
+    return VideoCaptureDeviceTizen::kCameraId0;
+}
+
+// static
+const std::string VideoCaptureDeviceTizen::GetBackCameraID() {
+  if (IsMobileProfile() || IsWearableProfile())
+    return VideoCaptureDeviceTizen::kCameraId0;
+  else
+    return VideoCaptureDeviceTizen::kCameraId1;
+}
 
 static CameraOrientation GetCameraOrientation(const char* device_id) {
-  for (size_t i = 0; i < arraysize(kCameraSpecs); i++) {
-    const CameraSpec& cameraspec = kCameraSpecs[i];
+  auto& camera_spec = GetCameraSpec();
+  for (size_t i = 0; i < camera_spec.size(); i++) {
+    const CameraSpec& cameraspec = camera_spec.at(i);
     if (strcmp(cameraspec.device_id_, device_id) == 0) {
       return cameraspec.orientation_;
     }
index 3ea8c97..3aa0fec 100644 (file)
@@ -19,8 +19,10 @@ class VideoCaptureDeviceTizen : public VideoCaptureDevice {
  public:
   const static std::string kFrontCameraName;
   const static std::string kBackCameraName;
-  const static std::string kFrontCameraId;
-  const static std::string kBackCameraId;
+  const static std::string kCameraId0;
+  const static std::string kCameraId1;
+  const static std::string GetFrontCameraID();
+  const static std::string GetBackCameraID();
 
   explicit VideoCaptureDeviceTizen(const Name& device_name);
   virtual ~VideoCaptureDeviceTizen() override;
index 04747a0..e7a983e 100644 (file)
@@ -37,7 +37,7 @@ if (tizen_multimedia_support) {
     external_media_efl_deps += [ "//tizen_src/build:libecore-wayland" ]
   }
 
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     external_media_efl_deps += [ "//tizen_src/build:capi-system-device" ]
     external_media_efl_deps += [ "//tizen_src/build:libcapi-system-device" ]
   }
diff --git a/tizen_src/chromium_impl/tizen/BUILD.gn b/tizen_src/chromium_impl/tizen/BUILD.gn
new file mode 100644 (file)
index 0000000..aadfb32
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright (c) 2015 Samsung Electronics. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//tizen_src/build/config/tizen_features.gni")
+
+static_library("system-info") {
+  configs += [ "//tizen_src/build:capi-system-info" ]
+  configs += [ "//tizen_src/build:libcapi-system-info" ]
+  public_configs = [ "//tizen_src/build:capi-system-info-public" ]
+
+  sources = [
+    "system_info.h",
+    "system_info.cc",
+  ]
+}
diff --git a/tizen_src/chromium_impl/tizen/system_info.cc b/tizen_src/chromium_impl/tizen/system_info.cc
new file mode 100644 (file)
index 0000000..002f4e8
--- /dev/null
@@ -0,0 +1,106 @@
+// Copyright (c) 2015 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <cstdlib>
+#include <string.h>
+#include "system_info.h"
+
+#if defined(OS_TIZEN)
+#include <system_info.h>
+#endif
+
+
+volatile Profile_Inform g_profile__ = PROFILE_UNKNOWN;
+volatile Arch_Inform g_arch__ = ARCH_UNKNOWN;
+
+void GetProfile(void) {
+  if (g_profile__ != PROFILE_UNKNOWN)
+    return;
+
+#if defined(OS_TIZEN)
+  char *profileName;
+  system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+  switch (*profileName) {
+  case 'm':
+  case 'M':
+    g_profile__ = PROFILE_MOBILE;
+    break;
+  case 'w':
+  case 'W':
+    g_profile__ = PROFILE_WEARABLE;
+    break;
+  case 't':
+  case 'T':
+    g_profile__ = PROFILE_TV;
+    break;
+  case 'i':
+  case 'I':
+    g_profile__ = PROFILE_IVI;
+    break;
+  default: // common or unknown ==> ALL ARE COMMON.
+    g_profile__ = PROFILE_COMMON;
+  }
+  free(profileName);
+#else // for desktop profile
+  g_profile__ = PROFILE_DESKTOP;
+#endif
+
+}
+
+int IsDesktopProfile(void) {
+  return GET_PROFILE() == PROFILE_DESKTOP ? 1 : 0;
+}
+
+int IsMobileProfile(void) {
+  return GET_PROFILE() == PROFILE_MOBILE ? 1 : 0;
+}
+
+int IsWearableProfile(void) {
+  return GET_PROFILE() == PROFILE_WEARABLE ? 1 : 0;
+}
+
+int IsTvProfile(void) {
+  return GET_PROFILE() == PROFILE_TV ? 1 : 0;
+}
+
+int IsIviProfile(void) {
+  return GET_PROFILE() == PROFILE_IVI ? 1 : 0;
+}
+
+int IsCommonProfile(void) {
+  return GET_PROFILE() == PROFILE_COMMON ? 1 : 0;
+}
+
+void GetArch(void) {
+#if defined(OS_TIZEN)
+  if (g_arch__ != ARCH_UNKNOWN)
+    return;
+
+  char *archName;
+  system_info_get_platform_string("http://tizen.org/feature/platform.core.cpu.arch", &archName);
+
+  int archNamelen = strlen(archName);
+  if (strncmp(archName, "armv7", archNamelen) == 0) {
+    g_arch__ = ARCH_ARMV7;
+  }
+  else if (strncmp(archName, "aarch64", archNamelen) == 0) {
+    g_arch__ = ARCH_AARCH64;
+  }
+  else if (strncmp(archName, "x86", archNamelen) == 0) {
+    g_arch__ = ARCH_X86;
+  }
+  else if (strncmp(archName, "x86_64", archNamelen) == 0) {
+    g_arch__ = ARCH_X86_64;
+  }
+  else {
+    g_arch__ = ARCH_UNKNOWN;
+  }
+  free(archName);
+#endif
+}
+
+int IsEmulatorArch(void) {
+  return GET_ARCH() == ARCH_X86 ? 1 : GET_ARCH() == ARCH_X86_64 ? 1 : 0;
+}
+
diff --git a/tizen_src/chromium_impl/tizen/system_info.h b/tizen_src/chromium_impl/tizen/system_info.h
new file mode 100644 (file)
index 0000000..e6e17e7
--- /dev/null
@@ -0,0 +1,85 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+//
+//    Licensed under the Apache License, Version 2.0 (the "License");
+//    you may not use this file except in compliance with the License.
+//    You may obtain a copy of the License at
+//
+//        http://www.apache.org/licenses/LICENSE-2.0
+//
+//    Unless required by applicable law or agreed to in writing, software
+//    distributed under the License is distributed on an "AS IS" BASIS,
+//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//    See the License for the specific language governing permissions and
+//    limitations under the License.
+
+#ifndef _PROFILE_INFO_H_
+#define _PROFILE_INFO_H_
+
+typedef enum {
+    PROFILE_UNKNOWN  = 1 << 1,
+    PROFILE_DESKTOP  = 1 << 2,
+    PROFILE_MOBILE   = 1 << 3,
+    PROFILE_WEARABLE = 1 << 4,
+    PROFILE_TV       = 1 << 5,
+    PROFILE_IVI      = 1 << 6,
+    PROFILE_COMMON   = 1 << 7
+} Profile_Inform;
+
+typedef enum {
+    ARCH_UNKNOWN = 1 << 1,
+    ARCH_ARMV7   = 1 << 2,
+    ARCH_AARCH64 = 1 << 3,
+    ARCH_X86     = 1 << 4,
+    ARCH_X86_64  = 1 << 5
+} Arch_Inform;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern volatile Profile_Inform g_profile__;
+extern volatile Arch_Inform g_arch__;
+
+void GetProfile();
+int IsDesktopProfile();
+int IsMobileProfile();
+int IsWearableProfile();
+int IsTvProfile();
+int IsIviProfile();
+int IsCommonProfile();
+
+void GetArch();
+int IsEmulatorArch();
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#define GET_PROFILE() ({ \
+    if(g_profile__ == PROFILE_UNKNOWN) \
+        GetProfile(); \
+    g_profile__; \
+})
+
+#define GET_ARCH() ({ \
+    if(g_arch__ == ARCH_UNKNOWN) \
+        GetArch(); \
+    g_arch__; \
+})
+
+#define IS_PROFILE(PROFILE)     GET_PROFILE() == PROFILE_##PROFILE ? 1: 0
+
+/*
+CURRENT PROFILE CAN BE GET WITH ABOVE MACRO FUCTION LIKE AS BELOW
+
+cout << "GET CURRENT PROFILE:" << GETPROFILE() <<endl;
+if(IS_PROFILE(MOBILE)) cout << "MOBILE PROFILE" <<endl;
+if(IS_PROFILE(DESKTOP)) cout << "DESKTOP PROFILE" <<endl;
+if(IS_PROFILE(WEARABLE)) cout << "WEARABLE PROFILE" <<endl;
+if(IS_PROFILE(TV)) cout << "TV PROFILE" <<endl;
+if(IS_PROFILE(IVI)) cout << "TV PROFILE" <<endl;
+if(IS_PROFILE(COMMON)) cout << "TV PROFILE" <<endl;
+*/
+
+#endif // _PLATFORM_INFO_H_
index a9f4de4..f65fde8 100644 (file)
@@ -5,6 +5,7 @@
 #include "ui/display/device_display_info_efl.h"
 
 #include "base/logging.h"
+#include "tizen/system_info.h"
 
 namespace display {
 
@@ -13,40 +14,44 @@ namespace {
 const double kBaselineDPIDensity = 160.0;
 const int kInvalidRotationDegrees = -1;
 
-#if defined(OS_TIZEN_MOBILE)
 int GetDensityRange(int dpi) {
-  // Copied from Android platform and extended to support UHD displays,
-  // (http://developer.android.com/reference/android/util/DisplayMetrics.html).
-  const int density_range[] = {
-    0,    // NODPI, ANYDPI
-    120,  // LOW
-    160,  // MEDIUM
-    240,  // HIGH
-    280,  // DPI_280
-    320,  // XHIGH
-    400,  // DPI_400
-    480,  // XXHIGH
-    560,  // DPI_560
-    640,  // XXXHIGH
-    720,  // DPI_720
-    800,  // ULTRAHIGH
-    880,  // DPI_880
-    960,  // ULTRAXHIGH
-    1040, // DPI_1040
-    1120, // ULTRAXXHIGH
-    1200, // DPI_1200
-    1280  // ULTRAXXXHIGH
-  };
-
-  const int range_size = sizeof(density_range) / sizeof(*density_range);
-  int upper_bound = density_range[range_size - 1];
-  for (int i = range_size - 2; i >= 0 && dpi <= density_range[i]; --i) {
-    upper_bound = density_range[i];
+  if (IsMobileProfile() || IsWearableProfile()) {
+    // Copied from Android platform and extended to support UHD displays,
+    // (http://developer.android.com/reference/android/util/DisplayMetrics.html).
+    const int density_range[] = {
+      0,    // NODPI, ANYDPI
+      120,  // LOW
+      160,  // MEDIUM
+      240,  // HIGH
+      280,  // DPI_280
+      320,  // XHIGH
+      400,  // DPI_400
+      480,  // XXHIGH
+      560,  // DPI_560
+      640,  // XXXHIGH
+      720,  // DPI_720
+      800,  // ULTRAHIGH
+      880,  // DPI_880
+      960,  // ULTRAXHIGH
+      1040, // DPI_1040
+      1120, // ULTRAXXHIGH
+      1200, // DPI_1200
+      1280  // ULTRAXXXHIGH
+    };
+
+    const int range_size = sizeof(density_range) / sizeof(*density_range);
+    int upper_bound = density_range[range_size - 1];
+    for (int i = range_size - 2; i >= 0 && dpi <= density_range[i]; --i) {
+      upper_bound = density_range[i];
+    }
+
+    return upper_bound;
+  } else {
+    // For platforms other than mobile, the user agents expect 1.0 as DIP scale
+    // for the contents to be delivered.
+    return 1.0;
   }
-
-  return upper_bound;
 }
-#endif
 
 }  // namespace
 
@@ -164,16 +169,16 @@ int DeviceDisplayInfoEfl::GetDisplayHeight() const {
 }
 
 double DeviceDisplayInfoEfl::ComputeDIPScale(int dpi) const {
-#if defined(OS_TIZEN_MOBILE)
-  double dip_scale = static_cast<double>(GetDensityRange(dpi));
-  DCHECK(dip_scale);
-  dip_scale /= kBaselineDPIDensity;
-  return dip_scale;
-#else
-  // For platforms other than mobile, the user agents expect 1.0 as DIP scale
-  // for the contents to be delivered.
-  return 1.0;
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    double dip_scale = static_cast<double>(GetDensityRange(dpi));
+    DCHECK(dip_scale);
+    dip_scale /= kBaselineDPIDensity;
+    return dip_scale;
+  } else {
+    // For platforms other than mobile, the user agents expect 1.0 as DIP scale
+    // for the contents to be delivered.
+    return 1.0;
+  }
 }
 
 double DeviceDisplayInfoEfl::GetDIPScale() const {
index 9c1693c..458f0d6 100644 (file)
@@ -489,11 +489,7 @@ EGLConfig EflPixmap::ChooseConfig() {
     EGL_ALPHA_SIZE, 8,
     EGL_DEPTH_SIZE, 24,
     EGL_STENCIL_SIZE, 8,
-#if defined(OS_TIZEN_TV)
-    EGL_SAMPLES, 4,
-#else
     EGL_SAMPLES, 2,
-#endif
     EGL_NONE
   };
 
index c5ff33f..3a80cbb 100644 (file)
@@ -39,7 +39,7 @@ if (!use_wayland) {
   external_ui_gfx_configs += [ "//tizen_src/build:ecore-x" ]
   external_ui_gfx_configs += [ "//tizen_src/build:libecore-x" ]
 
-  if (building_for_tizen) {
+  if (is_tizen) {
     # needed for efl_pixmap.cc/h
     external_ui_gl_configs += [ "//tizen_src/build:x11" ]
     external_ui_gl_configs += [ "//tizen_src/build:libx11" ]
@@ -47,6 +47,8 @@ if (!use_wayland) {
 } else {
   external_ui_gfx_configs += [ "//tizen_src/build:ecore-wayland" ]
   external_ui_gfx_configs += [ "//tizen_src/build:libecore-wayland" ]
+  external_ui_gfx_configs += [ "//tizen_src/build:capi-system-info" ]
+  external_ui_gfx_configs += [ "//tizen_src/build:libcapi-system-info" ]
 }
 
 if (use_ozone) {
@@ -83,7 +85,7 @@ external_ui_gl_sources = [
   "//tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc",
   "//tizen_src/chromium_impl/ui/gl/gl_current_context_efl.cc",
 ]
-if (building_for_tizen) {
+if (is_tizen) {
   external_ui_gl_sources += [
     "//tizen_src/chromium_impl/ui/gl/gl_image_efl_pixmap.cc",
     "//tizen_src/chromium_impl/ui/gl/gl_image_efl_pixmap.h",
index 5ba072b..92f9970 100644 (file)
@@ -109,7 +109,7 @@ shared_library("chromium-ewk") {
     "-w",
   ]
 
-  if (building_for_tizen) {
+  if (is_tizen) {
     exclude_source_set = [
       "browser/sound_effect.cc",
       "browser/sound_effect.h",
@@ -130,7 +130,7 @@ shared_library("chromium-ewk") {
   # but since m47 it failed to get properly "injected"
   # to device_battery target due to the new nesting
   # used in the target declaration.
-  if (building_for_tizen_mobile) {
+  if (is_tizen) {
     configs += [ "../../build:capi-system-device" ]
     configs += [ "../../build:libcapi-system-device" ]
     public_configs += [ "../../build:capi-system-device-public" ]
index c90c443..27b0077 100644 (file)
@@ -11,6 +11,7 @@
 #include "components/autofill/core/browser/popup_item_ids.h"
 #include "content/common/paths_efl.h"
 #include "eweb_view.h"
+#include "tizen/profile_info.h"
 
 #define AUTOFILL_POPUP_LABEL_COUNT  6 // Autofill component send 6 at max
 #define AUTOFILL_POPUP_LABEL_LEN    100
@@ -143,12 +144,12 @@ void AutofillPopupViewEfl::UpdateFormDataPopup(const gfx::RectF& bounds)
         itemSelectCb,
         static_cast<void*>(this));
   }
-#if defined(OS_TIZEN_MOBILE)
-  scale_factor = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().
-      device_scale_factor();
-#elif defined(OS_TIZEN_TV)
-  scale_factor = webview_->GetScale();
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    scale_factor = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().
+        device_scale_factor();
+  } else if (IsTvProfile()) {
+    scale_factor = webview_->GetScale();
+  }
 #ifdef OS_TIZEN
   elm_object_scale_set(autofill_list_, webview_->GetScale() / 2);
 #else
@@ -157,12 +158,13 @@ void AutofillPopupViewEfl::UpdateFormDataPopup(const gfx::RectF& bounds)
   evas_object_show(autofill_list_);
   int list_height = bounds.height() * scale_factor;
   // Show at max 3 item for mobile device
-#ifdef OS_TIZEN_MOBILE
-  if (values_.size() > 3) {
-    list_height = 3 * list_height;
-  } else
-#endif
-  {
+  if (IsMobileProfile() || IsWearableProfile()) {
+    if (values_.size() > 3) {
+      list_height = 3 * list_height;
+    } else {
+      list_height = values_.size() * list_height;
+    }
+  } else {
     list_height = values_.size() * list_height;
   }
 
index 23b346a..49ed53c 100644 (file)
@@ -20,6 +20,7 @@
 #include "components/user_prefs/user_prefs.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/browser_thread.h"
+#include "tizen/system_info.h"
 #include "ui/gfx/geometry/rect.h"
 #include "private/ewk_context_private.h"
 
@@ -114,12 +115,13 @@ void AutofillClientEfl::ShowAutofillPopup(
     return;
   int x, y;
   double scale_factor = 1.0;
-#if defined(OS_TIZEN_MOBILE)
-  scale_factor = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().
-      device_scale_factor();
-#elif defined(OS_TIZEN_TV)
-  scale_factor = webview_->GetScale();
-#endif
+
+  if (IsMobileProfile() || IsWearableProfile()) {
+    scale_factor = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().
+        device_scale_factor();
+  } else if (IsTvProfile()) {
+    scale_factor = webview_->GetScale();
+  }
 
 #if defined(OS_TIZEN)
   evas_object_geometry_get(webview_->evas_object(), &x, &y, 0, 0);
index 1682f1b..85b5419 100755 (executable)
@@ -12,6 +12,7 @@
 #include "content/common/paths_efl.h"
 #include "content/public/browser/web_contents.h"
 #include "eweb_view.h"
+#include "tizen/system_info.h"
 
 #include <math.h>
 #include <stdlib.h>
@@ -100,34 +101,34 @@ bool InputPicker::Layout::BuildColorSelector() {
   evas_object_size_hint_fill_set(color_picker, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(color_picker, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-#if defined(OS_TIZEN_TV)
-  elm_colorselector_color_set(color_picker, initial_r, initial_g, initial_b, 255);
-#else
-  Eina_List* color_list = const_cast<Eina_List*>
-      (elm_colorselector_palette_items_get(color_picker));
-  Eina_List* list = 0;
-  void* item = 0;
-  int r = 0;
-  int g = 0;
-  int b = 0;
-  int a = 0;
-  Elm_Object_Item* it = NULL;
-
-  EINA_LIST_FOREACH(color_list, list, item) {
-    if (item) {
-      elm_colorselector_palette_item_color_get((Elm_Object_Item*)item, &r, &g, &b, &a);
-      if (r == initial_r && g == initial_g && b == initial_b) {
-        it = (Elm_Object_Item*)item;
-        break;
+  if (IsTvProfile()) {
+    elm_colorselector_color_set(color_picker, initial_r, initial_g, initial_b, 255);
+  } else {
+    Eina_List* color_list = const_cast<Eina_List*>
+        (elm_colorselector_palette_items_get(color_picker));
+    Eina_List* list = 0;
+    void* item = 0;
+    int r = 0;
+    int g = 0;
+    int b = 0;
+    int a = 0;
+    Elm_Object_Item* it = NULL;
+
+    EINA_LIST_FOREACH(color_list, list, item) {
+      if (item) {
+        elm_colorselector_palette_item_color_get((Elm_Object_Item*)item, &r, &g, &b, &a);
+        if (r == initial_r && g == initial_g && b == initial_b) {
+          it = (Elm_Object_Item*)item;
+          break;
+        }
       }
     }
-  }
 
-  if (!it)
-    it = (Elm_Object_Item*)eina_list_nth(color_list, 0);
+    if (!it)
+      it = (Elm_Object_Item*)eina_list_nth(color_list, 0);
 
-  elm_object_item_signal_emit((Elm_Object_Item*)it, "elm,state,selected", "elm");
-#endif
+    elm_object_item_signal_emit((Elm_Object_Item*)it, "elm,state,selected", "elm");
+  }
 
   elm_object_part_content_set(layout, "colorpalette", color_picker);
   return true;
@@ -308,13 +309,15 @@ void InputPicker::SetPopupSize(int width, int height) {
     picker_layout_->SetPopupSize(width, height);
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 void InputPicker::endEditingCallback(
     void* data, Evas_Object* obj, void* event_info)
 {
-  InputPicker* inputPicker = static_cast<InputPicker*>(data);
-  if (inputPicker)
-    inputPicker->removeDatetimePickerDelayed();
+  if (IsMobileProfile() || IsWearableProfile()) {
+    InputPicker* inputPicker = static_cast<InputPicker*>(data);
+    if (inputPicker)
+      inputPicker->removeDatetimePickerDelayed();
+  }
 }
 #endif
 
@@ -664,12 +667,13 @@ void InputPicker::CreatePopupLayout(const char* title, struct tm* currentTime) {
 
   elm_datetime_value_set(picker_layout_->datePicker, currentTime);
 
-#if defined(OS_TIZEN_TV)
-  elm_object_signal_emit(picker_layout_->layout,"TV","align,swallow.datetime");
-#endif
-#if defined(OS_TIZEN_MOBILE)
-  evas_object_smart_callback_add(
-      picker_layout_->datePicker, "edit,end", endEditingCallback, 0);
+#if defined(OS_TIZEN)
+  if (IsTvProfile()) {
+    elm_object_signal_emit(picker_layout_->layout,"TV","align,swallow.datetime");
+  } else if (IsMobileProfile() || IsWearableProfile()) {
+    evas_object_smart_callback_add(
+        picker_layout_->datePicker, "edit,end", endEditingCallback, 0);
+  }
 #endif
 }
 
@@ -737,9 +741,11 @@ void InputPicker::CreateDateTimePopupLayout(const char* title, struct tm* curren
   elm_datetime_value_set(picker_layout_->datePicker, currentTime);
   elm_datetime_value_set(picker_layout_->time_picker, currentTime);
 
-#if defined(OS_TIZEN_MOBILE)
-  evas_object_smart_callback_add(
-      picker_layout_->datePicker, "edit,end", endEditingCallback, 0);
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    evas_object_smart_callback_add(
+        picker_layout_->datePicker, "edit,end", endEditingCallback, 0);
+  }
 #endif
 }
 
@@ -797,12 +803,13 @@ void InputPicker::CreateTimePopupLayout(const char* title, struct tm* currentTim
 
   elm_datetime_value_set(picker_layout_->time_picker, currentTime);
 
-#if defined(OS_TIZEN_TV)
-  elm_object_signal_emit(picker_layout_->layout,"TV","align,swallow.datetime");
-#endif
-#if defined(OS_TIZEN_MOBILE)
-  evas_object_smart_callback_add(
-      picker_layout_->time_picker, "edit,end", endEditingCallback, 0);
+#if defined(OS_TIZEN)
+  if (IsTvProfile()) {
+    elm_object_signal_emit(picker_layout_->layout,"TV","align,swallow.datetime");
+  } else if (IsMobileProfile() || IsWearableProfile()) {
+    evas_object_smart_callback_add(
+        picker_layout_->time_picker, "edit,end", endEditingCallback, 0);
+  }
 #endif
 }
 
index 1d5ba6d..6837713 100644 (file)
@@ -8,6 +8,7 @@
 #include "private/webview_delegate_ewk.h"
 
 #include "eweb_view.h"
+#include "tizen/system_info.h"
 
 using content::SelectionControllerEfl;
 
@@ -99,11 +100,11 @@ bool WebViewEvasEventHandler::HandleEvent_HWBack() {
     return true;
   }
 
-#if defined(OS_TIZEN_MOBILE)
-  // Tell the embedding APP to handle BACK HW.
-  webview_->SmartCallback<EWebViewCallbacks::HWBackUnhandled>().call();
-  return true;
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    // Tell the embedding APP to handle BACK HW.
+    webview_->SmartCallback<EWebViewCallbacks::HWBackUnhandled>().call();
+    return true;
+  }
 
   return false;
 }
index 212ec81..66e3404 100644 (file)
 #include "ui/events/event_switches.h"
 #include "extensions/common/switches.h"
 #include "efl/init.h"
+#include "tizen/system_info.h"
 #include "ui/base/ui_base_switches.h"
 #include "ui/gl/gl_switches.h"
 #include "url/gurl.h"
 
-
 int CommandLineEfl::argc_ = 0;
 char** CommandLineEfl::argv_ = NULL;
 CommandLineEfl::ArgumentVector CommandLineEfl::original_arguments_;
@@ -76,14 +76,16 @@ content::MainFunctionParams CommandLineEfl::GetDefaultPortParams() {
 #endif // EWK_BRINGUP
 #endif
 
-#if defined(OS_TIZEN_MOBILE)
-  p_command_line->AppendSwitchASCII(switches::kTouchEvents,
-                                    switches::kTouchEventsEnabled);
-  p_command_line->AppendSwitch(switches::kEnablePinch);
-  p_command_line->AppendSwitch(switches::kUseMobileUserAgent);
-  // [M42_2231] FIXME: Need Parallel Canvas patch for S-Chromium/S-Blink/S-Skia
-  p_command_line->AppendSwitchASCII(
-      switches::kAcceleratedCanvas2dMSAASampleCount, "4");
+#if !defined(EWK_BRINGUP)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    p_command_line->AppendSwitchASCII(switches::kTouchEvents,
+                                      switches::kTouchEventsEnabled);
+    p_command_line->AppendSwitch(switches::kEnablePinch);
+    p_command_line->AppendSwitch(switches::kUseMobileUserAgent);
+    // [M42_2231] FIXME: Need Parallel Canvas patch for S-Chromium/S-Blink/S-Skia
+    p_command_line->AppendSwitchASCII(
+        switches::kAcceleratedCanvas2dMSAASampleCount, "4");
+  }
 #endif
 
   p_command_line->AppendSwitch(switches::kDisableGpuVsync);
index f2529e4..904966b 100644 (file)
@@ -25,7 +25,7 @@ CONTENT_EXPORT extern const char kWidgetEncodedBundle[];
 
 // Turns on a bunch of settings (mostly on blink::WebView) for which there is no
 // command line switches. This allows desktop "ubrowser --mobile" to have
-// similar set of features that mobile build has (defined behind OS_TIZEN_MOBILE).
+// similar set of features that mobile build has.
 CONTENT_EXPORT extern const char kEwkEnableMobileFeaturesForDesktop[];
 
 CONTENT_EXPORT extern const char kLimitMemoryAllocationInScheduleDelayedWork[];
index 43db755..4145710 100644 (file)
@@ -15,6 +15,7 @@
 #include "base/command_line.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/user_agent.h"
+#include "tizen/system_info.h"
 
 #include "common/version_info_efl.h"
 
@@ -141,13 +142,13 @@ std::string VersionInfo::DefaultUserAgent() const {
   }
 
 // FIXME : The hard-coded user agent for tizen tv
-#if defined(OS_TIZEN_TV)
-  return "Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV+2013; Maple2012) "
-    "AppleWebKit/535.20+ (KHTML, like Gecko) SmartTV Safari/535.20+";
-#else
-  return content::BuildUserAgentFromOSAndProduct(EflWebView::VersionInfo::GetInstance()->OSType(),
-                                                     product);
-#endif
+  if (IsTvProfile()) {
+    return "Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV+2013; Maple2012) "
+      "AppleWebKit/535.20+ (KHTML, like Gecko) SmartTV Safari/535.20+";
+  } else {
+    return content::BuildUserAgentFromOSAndProduct(EflWebView::VersionInfo::GetInstance()->OSType(),
+                                                   product);
+  }
 }
 
 } //namespace EflWebView
index e875ea4..8c87884 100644 (file)
@@ -5,15 +5,13 @@
 #ifndef WEB_PREFERENCES_EFL_H
 #define WEB_PREFERENCES_EFL_H
 
+#include "tizen/system_info.h"
+
 // Contains settings from Ewk_Settings that do not belong to content::WebPreferences
 // and need to be sent to renderer.
 struct WebPreferencesEfl {
   bool shrinks_viewport_content_to_fit =
-#if defined(OS_TIZEN_MOBILE)
-      true;
-#else
-      false;
-#endif
+      IsMobileProfile() || IsWearableProfile() ? true : false;
   bool javascript_can_open_windows_automatically_ewk = true;
 };
 
index 664e669..a8004cc 100644 (file)
@@ -144,10 +144,12 @@ void ContextMenuControllerEfl::GetProposedContextMenu() {
     if (!params_.is_editable) {
       AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB,
           std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_WEB_SEARCH")));
-#if !defined(OS_TIZEN_MOBILE)
-      AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_IN_SPOTLIGHT,
-          std::string());
-#endif
+      if (!(IsMobileProfile() || IsWearableProfile())) {
+        AddItemToProposedList(
+            EWK_CONTEXT_MENU_ITEM_TYPE_ACTION,
+            EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_IN_SPOTLIGHT,
+            std::string());
+      }
     }
   }
 
@@ -467,9 +469,9 @@ bool ContextMenuControllerEfl::ShowContextMenu() {
     };
     evas_object_move(popup_, popup_position.x(), popup_position.y());
     evas_object_smart_callback_add(popup_, "dismissed", ContextMenuCancelCallback, this);
-#if defined(OS_TIZEN_MOBILE)
-    elm_ctxpopup_auto_hide_disabled_set(popup_, EINA_TRUE);
-#endif
+    if (IsMobileProfile() || IsWearableProfile()) {
+      elm_ctxpopup_auto_hide_disabled_set(popup_, EINA_TRUE);
+    }
     web_contents_.Focus();
   } else {
 #if defined(OS_TIZEN)
index e610639..0c5b1fc 100644 (file)
@@ -50,6 +50,7 @@
 #include "skia/ext/platform_canvas.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/web/web_find_options.h"
+#include "tizen/system_info.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/display/screen.h"
 #include "ui/events/event_switches.h"
@@ -1969,8 +1970,10 @@ bool EWebView::IsDragging() const {
 
 void EWebView::ShowFileChooser(content::RenderFrameHost* render_frame_host,
                                const content::FileChooserParams& params) {
-#if defined(OS_TIZEN_MOBILE)
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
+  if (!IsMobileProfile() && !IsWearableProfile())
+    return;
+
+#if !defined(EWK_BRINGUP)
   if (params.capture) {
     const std::string capture_types[] = {"video/*", "audio/*", "image/*"};
     unsigned int capture_types_num =
@@ -1986,7 +1989,6 @@ void EWebView::ShowFileChooser(content::RenderFrameHost* render_frame_host,
     }
   }
 #endif
-#endif
   file_chooser_.reset(
       new content::FileChooserControllerEfl(render_frame_host, &params));
   file_chooser_->Open();
@@ -2154,11 +2156,14 @@ void EWebView::InitializeContent() {
   evas_object_smart_member_add(native_view_, evas_object_);
 }
 
-#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
 void EWebView::cameraResultCb(service_h request,
                               service_h reply,
                               service_result_e result,
                               void* data) {
+  if (!IsMobileProfile() && !IsWearableProfile())
+    return;
+
   EWebView* webview = static_cast<EWebView*>(data);
   RenderViewHost* render_view_host =
       webview->web_contents_->GetRenderViewHost();
index 637dd50..9096892 100644 (file)
@@ -5,19 +5,17 @@
 #ifndef EWEB_VIEW_H
 #define EWEB_VIEW_H
 
-#if defined(OS_TIZEN_MOBILE)
 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
 // FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
 // include instead.
 #include <appcore-agent/service_app.h>
 #endif
-#include <vector>
-#endif
 
 #include <map>
 #include <string>
 #include <Evas.h>
 #include <locale.h>
+#include <vector>
 
 #include "base/callback.h"
 #include "base/containers/id_map.h"
@@ -488,14 +486,14 @@ class EWebView {
 
   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
 
-#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
   static void cameraResultCb(service_h request,
                              service_h reply,
                              service_result_e result,
                              void* data);
 #endif
 
-#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
+#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
   bool LaunchCamera(base::string16 mimetype);
 #endif
   content::RenderWidgetHostViewEfl* rwhv() const;
@@ -585,7 +583,7 @@ class EWebView {
   std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
   std::unique_ptr<ScrollDetector> scroll_detector_;
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
   content::FileChooserParams::Mode filechooser_mode_;
 #endif
   std::map<const _Ewk_Quota_Permission_Request*,
index 5192e8b..8ab6b1b 100644 (file)
@@ -133,9 +133,9 @@ enum CallbackType {
   WebloginReady,
   ZoomStarted,
   ZoomFinished,
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
   NewWindowNavigationPolicyDecision,
-#endif // OS_TIZEN_TV
+#endif // OS_TIZEN
   URIChanged
 };
 
@@ -275,9 +275,9 @@ DECLARE_EWK_VIEW_CALLBACK(WebloginCheckboxResume, "weblogin,checkbox,resume", vo
 DECLARE_EWK_VIEW_CALLBACK(WebloginReady, "weblogin,ready" , void);
 DECLARE_EWK_VIEW_CALLBACK(ZoomStarted, "zoom,started", void);
 DECLARE_EWK_VIEW_CALLBACK(ZoomFinished, "zoom,finished", void);
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 DECLARE_EWK_VIEW_CALLBACK(NewWindowNavigationPolicyDecision, "policy,decision,new,window", Ewk_Navigation_Policy_Decision*);
-#endif // OS_TIZEN_TV
+#endif // OS_TIZEN
 
 DECLARE_EWK_VIEW_CALLBACK(ContentsSizeChanged, "contents,size,changed", void);
 DECLARE_EWK_VIEW_CALLBACK(MenuBarVisible, "menubar,visible", bool*);
index a5f8ae8..576106b 100644 (file)
@@ -32,9 +32,7 @@ class Ewk_Settings {
         , m_textStyleState(true)
         , m_detectContentsAutomatically(true)
         , m_evas_object(evas_object)
-#if defined(OS_TIZEN_TV)
         , m_cacheBuilderEnabled(false)
-#endif
         , m_longPressEnabled(true)
         , m_linkMagnifierEnabled(false)
         , m_detectContentsEnabled(false)
@@ -91,9 +89,7 @@ class Ewk_Settings {
     WebPreferencesEfl& getPreferencesEfl() { return m_preferences_efl; }
     const WebPreferencesEfl& getPreferencesEfl() const { return m_preferences_efl; }
 
-#if defined(OS_TIZEN_TV)
     void setCacheBuilderEnabled(bool enable) { m_cacheBuilderEnabled = enable; }
-#endif
 
     /* ewk_extra_features related */
     void setLongPressEnabled(bool enable) { m_longPressEnabled = enable; }
@@ -139,9 +135,7 @@ class Ewk_Settings {
     bool m_detectContentsAutomatically;
 
     Evas_Object* m_evas_object;
-#if defined(OS_TIZEN_TV)
     bool m_cacheBuilderEnabled;
-#endif
 
     /* ewk_extra_features related */
     bool m_longPressEnabled;
index 9765a38..f9b27c5 100755 (executable)
@@ -3,14 +3,14 @@
 // found in the LICENSE file.
 
 #include "ewk_application_cache_manager.h"
-#include "private/ewk_private.h"
 #include "ewk_context.h"
+#include "private/ewk_private.h"
+#include "tizen/system_info.h"
 
 Eina_Bool ewk_application_cache_manager_clear(Ewk_Application_Cache_Manager* manager)
 {
-#if defined(OS_TIZEN_TV)
-  return ewk_context_application_cache_delete_all(ewk_context_default_get());
-#else
-  return EINA_FALSE;
-#endif // OS_TIZEN_TV
+  if (IsTvProfile())
+    return ewk_context_application_cache_delete_all(ewk_context_default_get());
+  else
+    return EINA_FALSE;
 }
index 51cd77e..9e239ff 100644 (file)
@@ -6,42 +6,43 @@
 #include "ewk_auth_request.h"
 #include "private/ewk_private.h"
 #include "private/ewk_auth_challenge_private.h"
+#include "tizen/system_info.h"
 
 Eina_Bool ewk_auth_request_authenticate(Ewk_Auth_Request* request, const char* username, const char* password)
 {
-#if defined(OS_TIZEN_TV)
-  EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
-  EINA_SAFETY_ON_NULL_RETURN_VAL(username, false);
-  EINA_SAFETY_ON_NULL_RETURN_VAL(password, false);
-  request->is_decided = true;
-  request->login_delegate->Proceed(username, password);
-  return true;
-#else
-  LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-  return false;
-#endif
+  if (IsTvProfile()) {
+    EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(username, false);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(password, false);
+    request->is_decided = true;
+    request->login_delegate->Proceed(username, password);
+    return true;
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+    return false;
+  }
 }
 
 Eina_Bool ewk_auth_request_cancel(Ewk_Auth_Request* request)
 {
-#if defined(OS_TIZEN_TV)
-  EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
-  request->is_decided = true;
-  request->login_delegate->Cancel();
-  return true;
-#else
-  LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-  return false;
-#endif
+  if (IsTvProfile()) {
+    EINA_SAFETY_ON_NULL_RETURN_VAL(request, false);
+    request->is_decided = true;
+    request->login_delegate->Cancel();
+    return true;
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+    return false;
+  }
 }
 
 const char* ewk_auth_request_realm_get(const Ewk_Auth_Request* request)
 {
-#if defined(OS_TIZEN_TV)
-  EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
-  return request->realm.c_str();
-#else
-  LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-  return NULL;
-#endif
+  if (IsTvProfile()) {
+    EINA_SAFETY_ON_NULL_RETURN_VAL(request, 0);
+    return request->realm.c_str();
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+    return NULL;
+  }
 }
index af4a4e4..a036165 100644 (file)
@@ -11,6 +11,7 @@
 #include "private/ewk_private.h"
 #include "private/ewk_settings_private.h"
 #include "private/ewk_view_private.h"
+#include "tizen/system_info.h"
 
 namespace {
 
@@ -455,25 +456,33 @@ Eina_Bool ewk_settings_clear_text_selection_automatically_get(const Ewk_Settings
 Eina_Bool ewk_settings_text_autosizing_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
 {
   EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
-#if defined(OS_TIZEN_MOBILE)
-  settings->getPreferences().text_autosizing_enabled = enable;
-  ewkUpdateWebkitPreferences(settings->getEvasObject());
-  return true;
+  if (IsMobileProfile() || IsWearableProfile()) {
+#if !defined(EWK_BRINGUP)
+    settings->getPreferences().text_autosizing_enabled = enable;
+    ewkUpdateWebkitPreferences(settings->getEvasObject());
+    return true;
 #else
-  LOG_EWK_API_MOCKUP("Only for Tizen Mobile Browser");
-  return false;
+    return false;
 #endif
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen Mobile Browser");
+    return false;
+  }
 }
 
 Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings* settings)
 {
   EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
-#if defined(OS_TIZEN_MOBILE)
-  return settings->getPreferences().text_autosizing_enabled;
+  if (IsMobileProfile() || IsWearableProfile()) {
+#if !defined(EWK_BRINGUP)
+    return settings->getPreferences().text_autosizing_enabled;
 #else
-  LOG_EWK_API_MOCKUP("Only for Tizen Mobile Browser");
-  return false;
+    return false;
 #endif
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen Mobile Browser");
+    return false;
+  }
 }
 
 Eina_Bool ewk_settings_text_autosizing_font_scale_factor_set(Ewk_Settings* settings, double factor)
@@ -582,12 +591,12 @@ Eina_Bool ewk_settings_detect_contents_automatically_get(const Ewk_Settings* set
 
 void ewk_settings_cache_builder_enabled_set(Ewk_Settings *settings, Eina_Bool enabled)
 {
-#if defined(OS_TIZEN_TV)
-  EINA_SAFETY_ON_NULL_RETURN(settings);
-  settings->setCacheBuilderEnabled(enabled);
-#else
-  LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-#endif
+  if (IsTvProfile()) {
+    EINA_SAFETY_ON_NULL_RETURN(settings);
+    settings->setCacheBuilderEnabled(enabled);
+  } else {
+    LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
+  }
 }
 
 int ewk_settings_default_font_size_get(const Ewk_Settings* settings)
index e53ab0b..08df9c3 100644 (file)
@@ -1115,12 +1115,7 @@ static Eina_Bool _ewk_view_default_notification_permission(
 
 void ewk_view_draw_focus_ring_enable_set(Evas_Object* ewkView, Eina_Bool enable)
 {
-#if defined(OS_TIZEN_TV) && !defined(EWK_BRINGUP)
-  EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);
-  impl->setDrawFocusRing(enable);
-#else
-   LOG_EWK_API_MOCKUP("Only for Tizen TV Browser");
-#endif
+  LOG_EWK_API_MOCKUP("This API is deprecated");
 }
 
 double ewk_view_page_zoom_get(const Evas_Object* ewkView)
index a5a93ab..93cc43a 100644 (file)
@@ -33,6 +33,7 @@ executable("efl_webview_app") {
   deps += [
     "//tizen_src/ewk/efl_integration:chromium-ewk",
     "//tizen_src/ewk/efl_integration:launch_exec",
+    "//tizen_src/chromium_impl/tizen:system-info",
   ]
   import("../tizen_version_defines_for_apps.gni")
   cflags = [
@@ -75,7 +76,7 @@ executable("mini_browser") {
   ldflags = []
   libs = []
   deps = []
-  if (building_for_tizen) {  # FIXME: mini_browser shouldn't depend on dlog and appcore-efl without OS(TIZEN) checks
+  if (is_tizen) {  # FIXME: mini_browser shouldn't depend on dlog and appcore-efl without OS(TIZEN) checks
     sources += [
       "browser-object.h",
       "browser-string.h",
@@ -102,6 +103,7 @@ executable("mini_browser") {
     configs += [ "//tizen_src/build:libelementary" ]
     public_configs += [ "//tizen_src/build:elementary-public" ]
     deps += [
+      "//tizen_src/chromium_impl/tizen:system-info",
       "//tizen_src/ewk/efl_integration:chromium-ewk",
       #"//build/linux:glib",   removed from the chromium
     ]
index 214002e..00e4961 100644 (file)
@@ -16,6 +16,7 @@
 #include "public/ewk_cookie_manager.h"
 #include "public/ewk_console_message.h"
 #include "public/ewk_user_media.h"
+#include "tizen/system_info.h"
 
 #include <Ecore.h>
 #include <Ecore_Evas.h>
@@ -25,7 +26,7 @@
 #include <Evas.h>
 #include <Elementary.h>
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include <device/haptic.h>
 #endif
 
@@ -59,7 +60,7 @@ static Ewk_Cookie_Accept_Policy set_cookie_policy;
 static Eina_List* application_cache_origins = NULL;
 static Eina_List* web_database_origins = NULL;
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static haptic_device_h g_haptic_handle;
 static Ecore_Timer *g_haptic_timer_id;
 static haptic_effect_h g_haptic_effect;
@@ -128,7 +129,7 @@ static void __back_forward_list_changed_cb(void *data, Evas_Object *obj, void *e
 static Eina_Bool __mime_override_cb(const char* url, const char *mime, char **new_mime, void* user_data);
 static void __console_message_cb(void *data, Evas_Object *obj, void *event_info);
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static Eina_Bool __vibration_timeout_cb(void *data);
 static void __vibration_on_cb(uint64_t vibration_time, void *data);
 static void __vibration_off_cb(void *data);
@@ -366,6 +367,26 @@ int main(int argc, char** argv)
   // By default the web process is the same program.
   fprintf(stderr, "efl_webview_app starting...\n");
 
+  if (IsDesktopProfile()) {
+    fprintf(stderr, "Runtime Profile : DESKTOP\n");
+  } else if (IsMobileProfile()) {
+    fprintf(stderr, "Runtime Profile : MOBILE\n");
+  } else if (IsTvProfile()) {
+    fprintf(stderr, "Runtime Profile : TV\n");
+  } else if (IsWearableProfile()) {
+    fprintf(stderr, "Runtime Profile : WEARABLE\n");
+  } else if (IsIviProfile()) {
+    fprintf(stderr, "Runtime Profile : IVI\n");
+  } else if (IsCommonProfile()) {
+    fprintf(stderr, "Runtime Profile : COMMON\n");
+  } else {
+    fprintf(stderr, "Runtime Profile : UNKNOWN\n");
+  }
+
+  if (IsEmulatorArch()) {
+    fprintf(stderr, "Runtime Architecture : EMULATOR\n");
+  }
+
   ewk_set_arguments(argc, argv);
   setenv("ELM_ENGINE", "gl", 1);
   elm_init(0,NULL);
@@ -501,8 +522,10 @@ int main(int argc, char** argv)
 
   ewk_view_notification_permission_callback_set(view, __notification_permission_cb, 0);
 
-#if defined(OS_TIZEN_MOBILE)
-  ewk_context_vibration_client_callbacks_set(context, __vibration_on_cb, __vibration_off_cb, NULL);
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    ewk_context_vibration_client_callbacks_set(context, __vibration_on_cb, __vibration_off_cb, NULL);
+  }
 #endif
 
   ewk_context_mime_override_callback_set(context, __mime_override_cb, 0);
@@ -1242,22 +1265,27 @@ void __edge_bottom_cb(void* data, Evas_Object* obj, void* event_info)
   printf("Edge_Bottom Notification\n");
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 Eina_Bool __vibration_timeout_cb(void *data)
 {
-  g_haptic_timer_id = NULL;
-  if (g_haptic_handle) {
-    device_haptic_stop(g_haptic_handle, g_haptic_effect);
-    device_haptic_close(g_haptic_handle);
-    g_haptic_handle = NULL;
-  }
+  if (IsMobileProfile() || IsWearableProfile()) {
+    g_haptic_timer_id = NULL;
+    if (g_haptic_handle) {
+      device_haptic_stop(g_haptic_handle, g_haptic_effect);
+      device_haptic_close(g_haptic_handle);
+      g_haptic_handle = NULL;
+    }
 
-  return ECORE_CALLBACK_CANCEL;
+    return ECORE_CALLBACK_CANCEL;
+  } else {
+    return EINA_TRUE;
+  }
 }
 
 void __vibration_on_cb(uint64_t vibration_time, void *data)
 {
-  printf("__vibration_on_cb called");
+  if (IsMobileProfile() || IsWearableProfile()) {
+    printf("__vibration_on_cb called");
     uint64_t duration = vibration_time;
 
     if (g_haptic_timer_id) {
@@ -1281,11 +1309,13 @@ void __vibration_on_cb(uint64_t vibration_time, void *data)
     printf("__vibration_on_cb:duration=%f", in);
 
     g_haptic_timer_id = ecore_timer_add(in, __vibration_timeout_cb, NULL);
+  }
 }
 
 void __vibration_off_cb(void *data)
 {
-  printf("__vibration_off_cb called");
+  if (IsMobileProfile() || IsWearableProfile()) {
+    printf("__vibration_off_cb called");
     if (g_haptic_timer_id) {
       ecore_timer_del(g_haptic_timer_id);
       g_haptic_timer_id = NULL;
@@ -1296,6 +1326,7 @@ void __vibration_off_cb(void *data)
       device_haptic_close(g_haptic_handle);
       g_haptic_handle = NULL;
     }
+  }
 }
 #endif
 
index e2844a9..f3ddfb3 100644 (file)
@@ -12,7 +12,7 @@
 #include <Evas.h>
 #include <Elementary.h>
 #include <glib/gprintf.h>
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 #include <Ecore_IMF_Evas.h>
 #endif
 
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include <device/haptic.h>
 #endif
 
@@ -36,6 +36,8 @@
 #include "browser-string.h"
 #include "browser-object.h"
 
+#include "tizen/system_info.h"
+
 #ifdef OS_TIZEN
 #include <efl_extension.h>
 #endif
 #define TOOL_BOX_HEIGHT 150
 #define URL_BOX_HEIGHT 75
 // SIP height in TV
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 #define IMF_START_POINT_Y 635
 #endif
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static haptic_device_h s_haptic_handle; // haptic handle.
 static Ecore_Timer* s_haptic_timer_id; // Timer ID.
 static haptic_effect_h s_haptic_effect; // haptic_effect struct.
@@ -60,7 +62,7 @@ static char* start_url = NULL;
 static int is_imf_shown = 0;
 //Added for SIP status
 static int im_context_status = 0;
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 static Evas_Object * curr_focus = NULL;
 #endif
 // We are just following Tizen platform application pattern.
@@ -159,7 +161,7 @@ static void __uri_changed_cb           (void *data, Evas_Object *obj, void *even
 static void __title_changed_cb         (void *data, Evas_Object *obj, void *event_info);
 static void __load_progress_cb         (void *data, Evas_Object *obj, void *event_info);
 
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 static void _url_clicked_cb             (void *data, Evas_Object *obj, void *event_info);
 static void _webview_mouse_down_cb      (void *data, Evas *e, Evas_Object *obj, void *event_info);
 #endif
@@ -184,7 +186,7 @@ static void __popup_cancel_url_cb(void *data, Evas_Object *obj, void *event_info
 
 static void url_hit_cb(void *data, Evas_Object *obj, void *event_info);
 static void _imf_panel_state_cb (void *data, Ecore_IMF_Context *ctx, int value);
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static void _imf_panel_changed_cb(void *data, Evas_Object *obj, Eina_Rectangle *rect);
 #endif
 
@@ -223,7 +225,7 @@ static Eina_Bool __javascript_alert_cb(Evas_Object* o, const char* alert_text, v
 static Eina_Bool __javascript_confirm_cb(Evas_Object* o, const char* message, void* user_data);
 static Eina_Bool __javascript_prompt_cb(Evas_Object* o, const char* message, const char* default_value, void* user_data);
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static Eina_Bool __vibration_timeout_cb(void *data);
 static void __vibration_on_cb(uint64_t vibration_time, void *data);
 static void __vibration_off_cb(void *data);
@@ -342,9 +344,9 @@ Evas_Object* _create_view(Evas_Object *parent, app_data *data)
   evas_object_smart_callback_add(webview, "load,progress,finished", __load_progress_finished_cb, data);
   evas_object_smart_callback_add(webview, "load,started"          , __load_started_cb          , data);
   evas_object_smart_callback_add(webview, "policy,newwindow,decide", __policy_newwindow_decide_cb, data);
-#if defined(OS_TIZEN_TV)
-  evas_object_event_callback_add(webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb       , data);
-#endif
+  if (IsTvProfile()) {
+    evas_object_event_callback_add(webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb       , data);
+  }
   evas_object_smart_callback_add(webview, "policy,response,decide", __policy_response_decide_cb, data);
   evas_object_smart_callback_add(webview, "policy,navigation,decide", __navigation_policy_decide_cb, data);
   evas_object_smart_callback_add(webview, "geolocation,permission,request", __geolocation_permission_request_cb, data);
@@ -354,10 +356,10 @@ Evas_Object* _create_view(Evas_Object *parent, app_data *data)
   ewk_view_javascript_confirm_callback_set(webview, __javascript_confirm_cb, data);
   ewk_view_javascript_prompt_callback_set(webview, __javascript_prompt_cb, data);
 
-#if defined(OS_TIZEN_MOBILE)
-  printf("[%s][%d][%s] calling ewk_context_vibration_client_callbacks_set...\n", __FUNCTION__, __LINE__, "vibration");
-  ewk_context_vibration_client_callbacks_set((Ewk_Context*) webview, __vibration_on_cb, __vibration_off_cb, NULL);
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    printf("[%s][%d][%s] calling ewk_context_vibration_client_callbacks_set...\n", __FUNCTION__, __LINE__, "vibration");
+    ewk_context_vibration_client_callbacks_set((Ewk_Context*) webview, __vibration_on_cb, __vibration_off_cb, NULL);
+  }
 
   //Added to support keyboard backspace key
   evas_object_smart_callback_add(webview, "editorclient,ime,opened", __im_context_open_cb  , data);
@@ -367,29 +369,31 @@ Evas_Object* _create_view(Evas_Object *parent, app_data *data)
   // To Enable customized context menu
   enable_customize_contextmenu(data, EINA_TRUE);
 
-#if defined(OS_TIZEN_MOBILE)
-  evas_object_smart_callback_add(webview, "inputmethod,changed", (Evas_Smart_Cb) _imf_panel_changed_cb , data);
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    evas_object_smart_callback_add(webview, "inputmethod,changed", (Evas_Smart_Cb) _imf_panel_changed_cb, data);
+  }
 
   return webview;
 }
 
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 // To bring back toolbar to original position when SID_DONE/SID_CANCEL is pressed
 static void _SIP_close_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-  Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
-  app_data *ad = (app_data*) data;
-  if (!strcmp(ev->key, "Select"))
-  {
-    const char* url = elm_entry_entry_get( ad->url_entry );
-    set_url_from_user_input(ad->webview, url);
-    hide_imf_panel(ad);
-    evas_object_focus_set(ad->webview, EINA_TRUE);
-  }
-  if (!strcmp(ev->key, "Cancel"))
-  {
-    hide_imf_panel(ad);
+  if (IsTvProfile()) {
+    Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
+    app_data *ad = (app_data*) data;
+    if (!strcmp(ev->key, "Select"))
+    {
+      const char* url = elm_entry_entry_get( ad->url_entry );
+      set_url_from_user_input(ad->webview, url);
+      hide_imf_panel(ad);
+      evas_object_focus_set(ad->webview, EINA_TRUE);
+    }
+    if (!strcmp(ev->key, "Cancel"))
+    {
+      hide_imf_panel(ad);
+    }
   }
 }
 
@@ -398,8 +402,10 @@ static void _SIP_close_cb(void *data, Evas *e, Evas_Object *obj, void *event_inf
  */
 void _webview_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-  app_data *ad = (app_data*) data;
-  hide_imf_panel(ad);
+  if (IsTvProfile()) {
+    app_data *ad = (app_data*) data;
+    hide_imf_panel(ad);
+  }
 }
 #endif
 
@@ -537,10 +543,12 @@ Evas_Object* _create_url_bar(Evas_Object *parent, int width, const char *start_u
   elm_box_pack_end(data->url_box, data->url_entry);
   evas_object_show(data->url_entry);
   evas_object_smart_callback_add(data->url_entry, "activated", url_hit_cb, data);
-  #if defined(OS_TIZEN_TV)
-  evas_object_event_callback_add(data->url_entry, EVAS_CALLBACK_KEY_DOWN, _SIP_close_cb, data);
-  evas_object_smart_callback_add(data->url_entry, "clicked", _url_clicked_cb, data);
-  #endif
+#if defined(OS_TIZEN)
+  if (IsTvProfile()) {
+    evas_object_event_callback_add(data->url_entry, EVAS_CALLBACK_KEY_DOWN, _SIP_close_cb, data);
+    evas_object_smart_callback_add(data->url_entry, "clicked", _url_clicked_cb, data);
+  }
+#endif
   elm_entry_prediction_allow_set(data->url_entry, EINA_FALSE);
 #ifdef OS_TIZEN
   eext_object_event_callback_add(data->url_entry, EEXT_CALLBACK_BACK, _back_hard_key_cb, data);
@@ -597,8 +605,6 @@ Evas_Object* _create_tool_bar(Evas_Object *parent, const char *start_url, app_da
   return data->tool_box;
 }
 
-//FIXME: The commented line below is for demo.
-//#if defined(OS_TIZEN_MOBILE)
 static void __br_rotate_cb(void *data, Evas_Object *obj, void *event)
 {
   if (!data)
@@ -627,14 +633,15 @@ static void _register_rotate_callback(Evas_Object *main_window, void *user_data)
   }
   evas_object_smart_callback_add(main_window, "wm,rotation,changed", __br_rotate_cb, user_data);
 }
-//#endif //#if defined(OS_TIZEN_MOBILE)
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 static void _on_focus_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-  app_data *ad = (app_data *) data;
-  set_url_from_user_input(ad->webview, start_url);
-  evas_object_event_callback_del(ad->main_window, EVAS_CALLBACK_FOCUS_IN, _on_focus_in_cb);
+  if (IsMobileProfile() || IsWearableProfile()) {
+    app_data *ad = (app_data *) data;
+    set_url_from_user_input(ad->webview, start_url);
+    evas_object_event_callback_del(ad->main_window, EVAS_CALLBACK_FOCUS_IN, _on_focus_in_cb);
+  }
 }
 #endif
 
@@ -673,23 +680,20 @@ static bool __br_app_create(void *data)
   evas_object_event_callback_add(ad->webview, EVAS_CALLBACK_KEY_UP, _on_keyup_cb , ad);
 #endif
 
-#if defined(OS_TIZEN_MOBILE)
-  evas_object_event_callback_add(ad->main_window, EVAS_CALLBACK_FOCUS_IN, _on_focus_in_cb, ad);
-#else
-  set_url_from_user_input(ad->webview, start_url);
-#endif
-//FIXME: The commented line below is for demo.
-//#if defined(OS_TIZEN_MOBILE)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    evas_object_event_callback_add(ad->main_window, EVAS_CALLBACK_FOCUS_IN, _on_focus_in_cb, ad);
+  } else {
+    set_url_from_user_input(ad->webview, start_url);
+  }
   _register_rotate_callback(ad->main_window, ad);
-//#endif
   return true;
 }
 static void __br_app_terminate(void* data)
 {
-  #if defined(OS_TIZEN_TV)
-  curr_focus = NULL;
-  hide_imf_panel(data);
-  #endif
+  if (IsTvProfile()) {
+    curr_focus = NULL;
+    hide_imf_panel(data);
+  }
 }
 
 static void __br_app_pause(void* data)
@@ -721,6 +725,27 @@ int main(int argc, char** argv)
   };
 
   printf("MINIB.C main \n");
+
+  if (IsDesktopProfile()) {
+    printf("Runtime Profile : DESKTOP(%d)\n", IsDesktopProfile());
+  } else if (IsMobileProfile()) {
+    printf("Runtime Profile : MOBILE(%d)\n", IsMobileProfile());
+  } else if (IsTvProfile()) {
+    printf("Runtime Profile : TV(%d)\n", IsTvProfile());
+  } else if (IsWearableProfile()) {
+    printf("Runtime Profile : WEARABLE(%d)\n", IsWearableProfile());
+  } else if (IsIviProfile()) {
+    printf("Runtime Profile : IVI(%d)\n", IsIviProfile());
+  } else if (IsCommonProfile()) {
+    printf("Runtime Profile : COMMON(%d)\n", IsCommonProfile());
+  } else {
+    printf("Runtime Profile : UNKNOWN\n");
+  }
+
+  if (IsEmulatorArch()) {
+    printf("Runtime Architecture : Emulator(%d)\n", IsEmulatorArch());
+  }
+
   if (ecore_getopt_parse(&options, values, argc, argv) < 0)
   {
     LOGE("ERROR: could not parse options.\n");
@@ -781,39 +806,41 @@ void __im_context_close_cb(void *data, Evas_Object *obj, void *event_info)
 {
   LOGD("IM_CONTEXT_EFL_OFF \n");
 
-#if defined(OS_TIZEN_MOBILE)
-  app_data *ad = (app_data *)data;
-  int changed_ang = elm_win_rotation_get(ad->main_window);
-  int main_window_width  = 0, main_window_height = 0;
-  get_main_window_size(&changed_ang, &main_window_width, &main_window_height);
-  evas_object_resize(ad->webview, main_window_width, main_window_height - TOOL_BOX_HEIGHT);
+  if (IsMobileProfile() || IsWearableProfile()) {
+    app_data *ad = (app_data *)data;
+    int changed_ang = elm_win_rotation_get(ad->main_window);
+    int main_window_width  = 0, main_window_height = 0;
+    get_main_window_size(&changed_ang, &main_window_width, &main_window_height);
+    evas_object_resize(ad->webview, main_window_width, main_window_height - TOOL_BOX_HEIGHT);
 
-  if (is_imf_shown) {
-    evas_object_move(ad->tool_box, 0, main_window_height - TOOL_BOX_HEIGHT);
-    evas_object_hide(ad->bg_tool_box);
-    elm_object_focus_set(ad->url_entry, EINA_FALSE);
-    is_imf_shown = 0;
+    if (is_imf_shown) {
+      evas_object_move(ad->tool_box, 0, main_window_height - TOOL_BOX_HEIGHT);
+      evas_object_hide(ad->bg_tool_box);
+      elm_object_focus_set(ad->url_entry, EINA_FALSE);
+      is_imf_shown = 0;
+    }
   }
-#endif
 
   im_context_status = 0;
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 void _imf_panel_changed_cb(void *data, Evas_Object *obj, Eina_Rectangle *rect)
 {
-  printf("__imf_panel_changed_cb\n");
-  LOGD("IM_CONTEXT_EFL_OFF \n");
+  if (IsMobileProfile() || IsWearableProfile()) {
+    printf("__imf_panel_changed_cb\n");
+    LOGD("IM_CONTEXT_EFL_OFF \n");
 
-  app_data *ad = (app_data *)data;
-  int changed_ang = elm_win_rotation_get(ad->main_window);
-  int main_window_width  = 0, main_window_height = 0;
-  get_main_window_size(&changed_ang, &main_window_width, &main_window_height);
+    app_data *ad = (app_data *)data;
+    int changed_ang = elm_win_rotation_get(ad->main_window);
+    int main_window_width  = 0, main_window_height = 0;
+    get_main_window_size(&changed_ang, &main_window_width, &main_window_height);
 
-  if (rect->h < TOOL_BOX_HEIGHT)
-    evas_object_resize(ad->webview, main_window_width, main_window_height - TOOL_BOX_HEIGHT);
-  else
-    evas_object_resize(ad->webview, main_window_width, main_window_height - rect->h);
+    if (rect->h < TOOL_BOX_HEIGHT)
+      evas_object_resize(ad->webview, main_window_width, main_window_height - TOOL_BOX_HEIGHT);
+    else
+      evas_object_resize(ad->webview, main_window_width, main_window_height - rect->h);
+  }
 }
 #endif
 
@@ -1069,32 +1096,34 @@ void zoomout_hit_cb(void *data, Evas_Object *obj, void *event_info)
   hide_imf_panel(ad);
 }
 
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
 /* On Click to Urlbar need to move Toolbar top of SIP
  * so that SIP and toolbar should not overlap
  */
 void _url_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
-  app_data *ad = (app_data*) data;
-  elm_entry_input_panel_enabled_set(ad->url_entry, EINA_TRUE);
-  if( curr_focus == NULL )
-    curr_focus = evas_focus_get(ad->e);
-  evas_object_focus_set(curr_focus, EINA_TRUE);
-  Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->url_entry);
-  if (imf_context)
-  {
-    if (!is_imf_shown && ecore_imf_context_input_panel_state_get(imf_context) != ECORE_IMF_INPUT_PANEL_STATE_SHOW)
+  if (IsTvProfile()) {
+    app_data *ad = (app_data*) data;
+    elm_entry_input_panel_enabled_set(ad->url_entry, EINA_TRUE);
+    if( curr_focus == NULL )
+      curr_focus = evas_focus_get(ad->e);
+    evas_object_focus_set(curr_focus, EINA_TRUE);
+    Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ad->url_entry);
+    if (imf_context)
     {
-      is_imf_shown = 1;
-      int x, y, w, h;
-      int width, height;
-      evas_object_geometry_get (ad->bg_tool_box, NULL, NULL, &width, &height);
-      ecore_imf_context_input_panel_geometry_get (imf_context, &x, &y, &w, &h);
-      //evas_object_resize(ad->webview, width, IMF_START_POINT_Y  - TOOL_BOX_HEIGHT); //To resize webview size above toolbar
-      evas_object_move(ad->bg_tool_box, 0, IMF_START_POINT_Y - TOOL_BOX_HEIGHT);
-      evas_object_show(ad->bg_tool_box);
-      evas_object_move(ad->tool_box, 0, IMF_START_POINT_Y - TOOL_BOX_HEIGHT);
-      elm_entry_input_panel_show(ad->url_entry);
+      if (!is_imf_shown && ecore_imf_context_input_panel_state_get(imf_context) != ECORE_IMF_INPUT_PANEL_STATE_SHOW)
+      {
+        is_imf_shown = 1;
+        int x, y, w, h;
+        int width, height;
+        evas_object_geometry_get (ad->bg_tool_box, NULL, NULL, &width, &height);
+        ecore_imf_context_input_panel_geometry_get (imf_context, &x, &y, &w, &h);
+        //evas_object_resize(ad->webview, width, IMF_START_POINT_Y  - TOOL_BOX_HEIGHT); //To resize webview size above toolbar
+        evas_object_move(ad->bg_tool_box, 0, IMF_START_POINT_Y - TOOL_BOX_HEIGHT);
+        evas_object_show(ad->bg_tool_box);
+        evas_object_move(ad->tool_box, 0, IMF_START_POINT_Y - TOOL_BOX_HEIGHT);
+        elm_entry_input_panel_show(ad->url_entry);
+      }
     }
   }
 }
@@ -1129,29 +1158,29 @@ void _imf_panel_state_cb (void *data, Ecore_IMF_Context *ctx, int value)
 
 void hide_imf_panel(app_data* data)
 {
-  #if defined(OS_TIZEN_TV)
-/* On SIP close, Toolbar bring back to original position*/
-  if (is_imf_shown) {
-    int width = 0, height = 0;
+  if (IsTvProfile()) {
+    /* On SIP close, Toolbar bring back to original position*/
+    if (is_imf_shown) {
+      int width = 0, height = 0;
 #if defined(USE_WAYLAND)
-    ecore_wl_screen_size_get(&width, &height);
+      ecore_wl_screen_size_get(&width, &height);
 #else
-    ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
+      ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
 #endif
-    //evas_object_resize(data->webview, width, height - TOOL_BOX_HEIGHT);
-    evas_object_move(data->bg_tool_box, 0, height - TOOL_BOX_HEIGHT);
-    evas_object_show(data->bg_tool_box);
-    evas_object_move(data->tool_box, 0, height - TOOL_BOX_HEIGHT);
-    evas_object_focus_set(curr_focus, EINA_FALSE);
+      //evas_object_resize(data->webview, width, height - TOOL_BOX_HEIGHT);
+      evas_object_move(data->bg_tool_box, 0, height - TOOL_BOX_HEIGHT);
+      evas_object_show(data->bg_tool_box);
+      evas_object_move(data->tool_box, 0, height - TOOL_BOX_HEIGHT);
+      evas_object_focus_set(curr_focus, EINA_FALSE);
+      elm_entry_input_panel_hide(data->url_entry);
+      evas_object_focus_set(data->webview, EINA_TRUE);
+      is_imf_shown = 0;
+    }
+  } else {
+    elm_object_focus_set(data->url_entry, EINA_FALSE);
     elm_entry_input_panel_hide(data->url_entry);
-    evas_object_focus_set(data->webview, EINA_TRUE);
     is_imf_shown = 0;
   }
-  #else
-  elm_object_focus_set(data->url_entry, EINA_FALSE);
-  elm_entry_input_panel_hide(data->url_entry);
-  is_imf_shown = 0;
-  #endif
 }
 
 void _back_btn_cb(void *data, Evas_Object *btn, void *ev)
@@ -1254,17 +1283,17 @@ void _back_hard_key_cb(void *data, Evas_Object *btn, void *ev)
     __popup_close(ad);
     return;
   }
-#if defined(OS_TIZEN_TV)
-  /* SIP in TV has dedicated Close button but in Mobile Backkey is used as Close
-   * For TV, On SIP Close Press only Hide IMF, Don't allow Navigation Back
-   * Navigation back is handled seperatly for Backkey Event, where as
-   * For Mobile, Backkey is used as SIP Close button and Navigation Back
-   */
-  hide_imf_panel(ad);
-#else
-  if (is_imf_shown)
-    evas_object_focus_set(ad->webview, EINA_TRUE);
-#endif
+  if (IsTvProfile()) {
+    /* SIP in TV has dedicated Close button but in Mobile Backkey is used as Close
+     * For TV, On SIP Close Press only Hide IMF, Don't allow Navigation Back
+     * Navigation back is handled seperatly for Backkey Event, where as
+     * For Mobile, Backkey is used as SIP Close button and Navigation Back
+     */
+    hide_imf_panel(ad);
+  } else {
+    if (is_imf_shown)
+      evas_object_focus_set(ad->webview, EINA_TRUE);
+  }
 }
 #endif
 
@@ -1510,19 +1539,23 @@ Eina_Bool __javascript_prompt_cb(Evas_Object* o, const char* message, const char
   return EINA_TRUE;
 }
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 // To support vibration: this is a timeout callback.
 // The original source code author is kinipk.
 Eina_Bool __vibration_timeout_cb(void *data)
 {
-  s_haptic_timer_id = NULL;
-  if (s_haptic_handle) {
-    device_haptic_stop(s_haptic_handle, s_haptic_effect);
-    device_haptic_close(s_haptic_handle);
-    s_haptic_handle = NULL;
-  }
+  if (IsMobileProfile() || IsWearableProfile()) {
+    s_haptic_timer_id = NULL;
+    if (s_haptic_handle) {
+      device_haptic_stop(s_haptic_handle, s_haptic_effect);
+      device_haptic_close(s_haptic_handle);
+      s_haptic_handle = NULL;
+    }
 
-  return ECORE_CALLBACK_CANCEL;
+    return ECORE_CALLBACK_CANCEL;
+  } else {
+    return EINA_TRUE;
+  }
 }
 
 // To support vibration: @see |ewk_context_vibration_client_callbacks_set|, also.
@@ -1571,7 +1604,7 @@ void __vibration_off_cb(void *data)
     s_haptic_handle = NULL;
   }
 }
-#endif // #if caluse of #if defined(OS_TIZEN_MOBILE)...
+#endif // #if caluse of #if defined(OS_TIZEN)...
 
 void mini_find_word(const char *word, Eina_Bool forward, Evas_Smart_Cb found_cb, void *data)
 {
index d605580..aafae4c 100644 (file)
@@ -6,7 +6,7 @@ import("//tizen_src/build/config/tizen_features.gni")
 
 defines = []
 
-if (building_for_tizen) {
+if (is_tizen) {
   if (chromium_efl_tizen_version == 30) {
     defines += [ "TIZEN_V_3_0=true" ]
   }
index 78ba787..3aa7aff 100644 (file)
@@ -29,6 +29,7 @@ executable("ubrowser") {
   public_configs += [ "//tizen_src/build:elementary-public" ]
   deps = [
     "//build/config:exe_and_shlib_deps",
+    "//tizen_src/chromium_impl/tizen:system-info",
     "//tizen_src/ewk/efl_integration:chromium-ewk",
     "//tizen_src/ewk/efl_integration:launch_exec",
   ]
@@ -66,7 +67,7 @@ executable("ubrowser") {
   ]
   ldflags = []
   libs = []
-  if (building_for_tizen) {
+  if (is_tizen) {
     configs += [ "//tizen_src/build:capi-appfw-application" ]
     configs += [ "//tizen_src/build:libcapi-appfw-application" ]
   }
index ff13d93..3dcda61 100644 (file)
@@ -4,12 +4,13 @@
 
 #include "browser.h"
 
+#include "logger.h"
+#include "tizen/system_info.h"
+
 #include <assert.h>
 #include <ewk_context.h>
 #include <ewk_tracing.h>
 
-#include "logger.h"
-
 static std::string kHomePage = "http://www.google.com";
 static int kDefaultMobileWindowWidth = 360;
 static int kDefaultMobileWindowHeight = 640;
@@ -29,6 +30,26 @@ Browser::Browser(bool desktop)
 
   log_info("UI type: %s", desktop_ ? "desktop" : "mobile");
 
+  if (IsDesktopProfile()) {
+    log_info("Runtime Profile : DESKTOP : ", IsDesktopProfile());
+  } else if (IsMobileProfile()) {
+    log_info("Runtime Profile : MOBILE : ", IsMobileProfile());
+  } else if (IsTvProfile()) {
+    log_info("Runtime Profile : TV : ", IsTvProfile());
+  } else if (IsWearableProfile()) {
+    log_info("Runtime Profile : WEARABLE : ", IsWearableProfile());
+  } else if (IsIviProfile()) {
+    log_info("Runtime Profile : IVI : ", IsIviProfile());
+  } else if (IsCommonProfile()) {
+    log_info("Runtime Profile : COMMON : ", IsCommonProfile());
+  } else {
+    log_info("Runtime Profile : UNKNOWN : ");
+  }
+
+  if (IsEmulatorArch()) {
+    log_info("Runtime Architecture : EMUULATOR : ", IsEmulatorArch());
+  }
+
   // If we don't call ewk_context_default_get here, ubrowser crashes in desktop
   // mode. This is a hack.
   // FIXME: find a real fix
@@ -171,32 +192,35 @@ void Browser::StopTracing() {
 
 void Browser::StartVibration(uint64_t duration) {
   log_trace("%s: %d", __PRETTY_FUNCTION__, duration);
-#if defined(OS_TIZEN_MOBILE)
-  if (haptic_timer_id_) {
-    ecore_timer_del(haptic_timer_id_);
-    haptic_timer_id_ = NULL;
-  }
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
+    if (haptic_timer_id_) {
+      ecore_timer_del(haptic_timer_id_);
+      haptic_timer_id_ = NULL;
+    }
 
-  if (haptic_handle_) {
-    device_haptic_stop(haptic_handle_, haptic_effect_);
-    device_haptic_close(haptic_handle_);
-    haptic_handle_ = NULL;
-  }
+    if (haptic_handle_) {
+      device_haptic_stop(haptic_handle_, haptic_effect_);
+      device_haptic_close(haptic_handle_);
+      haptic_handle_ = NULL;
+    }
 
-  if (device_haptic_open(0, &haptic_handle_) != DEVICE_ERROR_NONE) {
-    log_error("__vibration_on_cb:device_haptic_open failed");
-    return;
-  }
+    if (device_haptic_open(0, &haptic_handle_) != DEVICE_ERROR_NONE) {
+      log_error("__vibration_on_cb:device_haptic_open failed");
+      return;
+    }
 
-  device_haptic_vibrate(haptic_handle_, duration, 100, &haptic_effect_);
-  double in = (double)((double)(duration) / (double)(1000));
-  haptic_timer_id_ = ecore_timer_add(in, &Browser::OnVibrationTimeout, this);
+    device_haptic_vibrate(haptic_handle_, duration, 100, &haptic_effect_);
+    double in = (double)((double)(duration) / (double)(1000));
+    haptic_timer_id_ = ecore_timer_add(in, &Browser::OnVibrationTimeout, this);
+  }
 #endif
 }
 
 void Browser::StopVibration() {
   log_trace("%s", __PRETTY_FUNCTION__);
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
+  if (IsMobileProfile() || IsWearableProfile()) {
     if (haptic_timer_id_) {
       ecore_timer_del(haptic_timer_id_);
       haptic_timer_id_ = NULL;
@@ -207,6 +231,7 @@ void Browser::StopVibration() {
       device_haptic_close(haptic_handle_);
       haptic_handle_ = NULL;
     }
+  }
 #endif
 }
 
index 0c83eb0..7423b95 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "window.h"
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
 #include <device/haptic.h>
 #endif
 
@@ -71,7 +71,7 @@ class Browser {
   bool inspector_started_;
   bool tracing_enabled_;
 
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
   Ecore_Timer* haptic_timer_id_;
   haptic_device_h haptic_handle_;
   haptic_effect_h haptic_effect_;
index af80e8a..1d2b107 100644 (file)
@@ -17,6 +17,8 @@
 #include "logger.h"
 #include "window.h"
 
+#include "tizen/system_info.h"
+
 namespace {
 static std::string kDefaultNewWindowURL = "http://www.google.com";
 static double kMinViewScale = 1.0;
@@ -172,11 +174,12 @@ Evas_Object* WindowUI::CreateExtraActionsMenu(Evas_Object* parent) {
   }
   menu_ =  elm_ctxpopup_add(parent);
 
-#if defined(OS_TIZEN_MOBILE)
-  int width;
-  evas_object_geometry_get(parent, 0, 0, &width, 0);
-  evas_object_size_hint_min_set(menu_, width, 0);
-#endif
+  if (IsMobileProfile() || IsWearableProfile()) {
+    int width;
+    evas_object_geometry_get(parent, 0, 0, &width, 0);
+    evas_object_size_hint_min_set(menu_, width, 0);
+  }
+
   evas_object_smart_callback_add(menu_, "dismissed", _HideCtxPopup, NULL);
 
   if (window_.IsFormProfileEnabled()) {
index cbe423f..5882210 100644 (file)
@@ -381,7 +381,7 @@ test("ewk_unittests") {
 
   #TODO : Uncomment it.
   #deps += [ ":libbundle" ]
-  if (building_for_tizen) {
+  if (is_tizen) {
     cflags += [ "-scim" ]
     ldflags += [ "-scim" ]
     libs += [ "scim" ]