if (use_efl) {
sources += external_content_browser_efl_sources
- if (building_for_tizen_mobile) {
+ if (is_tizen) {
sources -= external_exclude_content_browser_efl_sources
}
}
"//url/ipc:url_ipc",
]
+ if (use_efl) {
+ deps += external_content_common_efl_deps
+ }
+
defines = []
include_dirs = []
libs = []
#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 {
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;
"//third_party/opus",
]
- if (building_for_tizen) {
+ if (is_tizen) {
sources -= [
"pepper/video_decoder_shim.cc",
"pepper/video_decoder_shim.h",
#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;
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)
%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
#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
%if 0%{?component_build}
"component=\"shared_library\"" \
%endif
+ "is_tizen=true"
ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" \
%if 0%{?_enable_content_shell}
}
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" ]
}
}
}
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" ]
}
}
}
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" ]
}
}
}
}
- if (building_for_tizen) {
+ if (is_tizen) {
defines += [
"OS_TIZEN",
"WTF_OS_TIZEN",
}
}
- 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",
- ]
- }
- }
}
declare_args() {
gcc_version = 49
+ is_tizen = false
use_wayland = false
# 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/"
prebuilt_ld_gold_dir = ""
chromium_efl_tizen_version = 24
tizen_tbm_support = false
- building_for_tizen = false
}
if (is_tizen && tizen_multimedia_support) {
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}"
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#')
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
}
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
$COMMON_GN_PARAMETERS
$ADDITIONAL_GN_PARAMETERS
$EXTRA_GN_ARGS
- "
+"
printf "GN_ARGUMENTS:\n"
for arg in $_GN_ARGS; do
printf " * ${arg##-D}\n"
"//tizen_src/build:libtts",
]
-if (building_for_tizen) {
+if (is_tizen) {
external_content_browser_efl_configs += [
"//tizen_src/build:vconf",
"//tizen_src/build:libvconf",
"//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 += [
// 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 {
}
bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
-#if defined(OS_TIZEN_MOBILE)
+ if (!(IsMobileProfile() || IsWearableProfile()))
+ return false;
+
DCHECK(buffer);
switch (consumer_type) {
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();
default:
NOTREACHED();
}
-#endif // OS_TIZEN_MOBILE
return false;
}
#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
}
}
- if (resumed_queue_.size() < kMaximumPlayerCount)
+ if (resumed_queue_.size() < GetMaximumPlayerCount())
resumed_queue_.push_back(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();
#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
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;
#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"
#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
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)
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
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
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;
}
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
#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"
: 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
"EXE_DIR=\"$exe_dir\"",
]
- if (building_for_tizen) {
+ if (is_tizen) {
defines += [
"EDJE_DIR=\"$edje_dir\"",
"LOCALE_DIR=\"$locale_dir\"",
# 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
"//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",
]
}
-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",
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",
##############################################################################
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",
#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"
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
}
manager()->OnNetworkStateChange(GetPlayerId(), state);
-
-#if defined(OS_TIZEN_MOBILE)
ReleaseDisplayLock();
-#endif
}
} // namespace media
#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 {
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)
}
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
// Removes query string from URI.
MEDIA_EXPORT GURL GetCleanURL(std::string url);
-#if defined(OS_TIZEN_MOBILE)
void WakeUpDisplayAndAcquireDisplayLock();
void ReleaseDisplayLock();
-#endif
} // namespace media
return;
}
-#if defined(OS_TIZEN_MOBILE)
WakeUpDisplayAndAcquireDisplayLock();
-#endif
+
StartCurrentTimeUpdateTimer();
if (!is_file_url_)
StartBufferingUpdateTimer();
if (!is_file_url_)
StartBufferingUpdateTimer();
-#if defined(OS_TIZEN_MOBILE)
ReleaseDisplayLock();
-#endif
-
StopCurrentTimeUpdateTimer();
is_paused_ = true;
}
void MediaPlayerBridgeCapi::PlaybackCompleteUpdate() {
is_end_reached_ = true;
-#if defined(OS_TIZEN_MOBILE)
ReleaseDisplayLock();
-#endif
StopCurrentTimeUpdateTimer();
manager()->OnTimeUpdate(GetPlayerId(), GetCurrentTime());
return;
}
-#if defined(OS_TIZEN_MOBILE)
WakeUpDisplayAndAcquireDisplayLock();
-#endif
+
int ret = player_start(player_);
if (ret != PLAYER_ERROR_NONE) {
OnHandlePlayerError(ret, FROM_HERE);
}
StopCurrentTimeUpdateTimer();
if (!is_media_related_action) {
-#if defined(OS_TIZEN_MOBILE)
ReleaseDisplayLock();
-#endif
}
playing_ = false;
}
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
}
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);
}
}
#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;
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_;
}
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;
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" ]
}
--- /dev/null
+# 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",
+ ]
+}
--- /dev/null
+// 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;
+}
+
--- /dev/null
+// 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_
#include "ui/display/device_display_info_efl.h"
#include "base/logging.h"
+#include "tizen/system_info.h"
namespace display {
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
}
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 {
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
};
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" ]
} 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) {
"//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",
"-w",
]
- if (building_for_tizen) {
+ if (is_tizen) {
exclude_source_set = [
"browser/sound_effect.cc",
"browser/sound_effect.h",
# 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" ]
#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
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
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;
}
#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"
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);
#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>
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;
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
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
}
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
}
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
}
#include "private/webview_delegate_ewk.h"
#include "eweb_view.h"
+#include "tizen/system_info.h"
using content::SelectionControllerEfl;
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;
}
#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_;
#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);
// 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[];
#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"
}
// 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
#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;
};
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());
+ }
}
}
};
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)
#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"
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 =
}
}
#endif
-#endif
file_chooser_.reset(
new content::FileChooserControllerEfl(render_frame_host, ¶ms));
file_chooser_->Open();
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();
#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"
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;
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*,
WebloginReady,
ZoomStarted,
ZoomFinished,
-#if defined(OS_TIZEN_TV)
+#if defined(OS_TIZEN)
NewWindowNavigationPolicyDecision,
-#endif // OS_TIZEN_TV
+#endif // OS_TIZEN
URIChanged
};
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*);
, 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)
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; }
bool m_detectContentsAutomatically;
Evas_Object* m_evas_object;
-#if defined(OS_TIZEN_TV)
bool m_cacheBuilderEnabled;
-#endif
/* ewk_extra_features related */
bool m_longPressEnabled;
// 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;
}
#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;
+ }
}
#include "private/ewk_private.h"
#include "private/ewk_settings_private.h"
#include "private/ewk_view_private.h"
+#include "tizen/system_info.h"
namespace {
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)
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)
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)
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 = [
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",
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
]
#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>
#include <Evas.h>
#include <Elementary.h>
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
#include <device/haptic.h>
#endif
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;
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);
// 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);
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);
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) {
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;
device_haptic_close(g_haptic_handle);
g_haptic_handle = NULL;
}
+ }
}
#endif
#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
#include <stdlib.h>
#include <string.h>
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
#include <device/haptic.h>
#endif
#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.
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.
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
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
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);
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);
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);
// 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);
+ }
}
}
*/
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
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);
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)
}
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
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)
};
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");
{
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
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);
+ }
}
}
}
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)
__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
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.
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)
{
defines = []
-if (building_for_tizen) {
+if (is_tizen) {
if (chromium_efl_tizen_version == 30) {
defines += [ "TIZEN_V_3_0=true" ]
}
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",
]
]
ldflags = []
libs = []
- if (building_for_tizen) {
+ if (is_tizen) {
configs += [ "//tizen_src/build:capi-appfw-application" ]
configs += [ "//tizen_src/build:libcapi-appfw-application" ]
}
#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;
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
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;
device_haptic_close(haptic_handle_);
haptic_handle_ = NULL;
}
+ }
#endif
}
#include "window.h"
-#if defined(OS_TIZEN_MOBILE)
+#if defined(OS_TIZEN)
#include <device/haptic.h>
#endif
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_;
#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;
}
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()) {
#TODO : Uncomment it.
#deps += [ ":libbundle" ]
- if (building_for_tizen) {
+ if (is_tizen) {
cflags += [ "-scim" ]
ldflags += [ "-scim" ]
libs += [ "scim" ]