From 80a64f9f5fa05585a39bd906c51f9c9511689856 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Wed, 11 Feb 2015 17:46:37 +0900 Subject: [PATCH] [TV] Disabling unsupported sensor feature on TV target The TV target does not support sensor feature such as orientation, accelerometer, gyroscope, and etc. Thus, it needs to be disabled. Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=11280 Reviewed by: Antonio Gomes, KC Park Change-Id: I92a96438a25bedaf6657c9881e8c90b2d56afe8f Signed-off-by: Youngsoo Choi --- .../data_fetcher_shared_memory_tizen.cc | 7 ++++++- .../renderer_host/render_widget_host_view_efl.cc | 8 ++++++-- tizen_src/impl/chromium-efl-deps.gyp | 11 +---------- tizen_src/impl/chromium-efl.gyp | 12 ++++++------ tizen_src/impl/eweb_view.cc | 6 ++++-- .../public/tw_webview_evas_event_handler.cc | 12 +++++++----- tizen_src/packaging/chromium-efl.spec | 2 +- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/tizen_src/impl/browser/device_sensors/data_fetcher_shared_memory_tizen.cc b/tizen_src/impl/browser/device_sensors/data_fetcher_shared_memory_tizen.cc index 8082d8fb50b3..6b3bcefc6f6b 100644 --- a/tizen_src/impl/browser/device_sensors/data_fetcher_shared_memory_tizen.cc +++ b/tizen_src/impl/browser/device_sensors/data_fetcher_shared_memory_tizen.cc @@ -2,8 +2,9 @@ // 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) #include "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" @@ -18,6 +19,7 @@ DataFetcherSharedMemory::~DataFetcherSharedMemory() { } bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { +#if defined(OS_TIZEN_MOBILE) DCHECK(buffer); switch (consumer_type) { @@ -32,10 +34,12 @@ 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) switch (consumer_type) { case CONSUMER_TYPE_MOTION: DataFetcherImplTizen::GetInstance()->StopFetchingDeviceMotionData(); @@ -46,6 +50,7 @@ bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) { default: NOTREACHED(); } +#endif // OS_TIZEN_MOBILE return false; } diff --git a/tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.cc b/tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.cc index 48c8fc5fed90..1981d6673a7a 100644 --- a/tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.cc +++ b/tizen_src/impl/browser/renderer_host/render_widget_host_view_efl.cc @@ -57,7 +57,9 @@ #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_types.h" #include "ui/events/gestures/gesture_recognizer.h" +#if defined(OS_TIZEN_MOBILE) #include "browser/motion/wkext_motion.h" +#endif #include "content/common/input_messages.h" #include "components/clipboard/clipboard_helper_efl.h" #include "common/webcursor_efl.h" @@ -1253,6 +1255,7 @@ void RenderWidgetHostViewEfl::HandleEvasEvent(const Evas_Event_Key_Up* event) { } #if defined(OS_TIZEN) +#if defined(OS_TIZEN_MOBILE) void RenderWidgetHostViewEfl::FilterInputMotion(const blink::WebGestureEvent& gesture_event) { if (gesture_event.type == blink::WebInputEvent::GesturePinchUpdate) { Evas_Coord_Point position; @@ -1262,9 +1265,10 @@ void RenderWidgetHostViewEfl::FilterInputMotion(const blink::WebGestureEvent& ge wkext_motion_tilt_position_update(&position); } } +#endif void RenderWidgetHostViewEfl::makePinchZoom(void* eventInfo) { -#if !defined(EWK_BRINGUP) +#if !defined(EWK_BRINGUP) && defined(OS_TIZEN_MOBILE) Wkext_Motion_Event* motionEvent = static_cast(eventInfo); ui::GestureEvent event(ui::ET_GESTURE_PINCH_UPDATE, @@ -1379,7 +1383,7 @@ ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) { void RenderWidgetHostViewEfl::SendGestureEvent( blink::WebGestureEvent& event) { HandleGesture(event); -#if defined(OS_TIZEN) +#if defined(OS_TIZEN_MOBILE) FilterInputMotion(event); #endif if (m_magnifier && event.type == blink::WebInputEvent::GestureScrollUpdate) diff --git a/tizen_src/impl/chromium-efl-deps.gyp b/tizen_src/impl/chromium-efl-deps.gyp index 4b920f4bdb50..d218a8490c4f 100755 --- a/tizen_src/impl/chromium-efl-deps.gyp +++ b/tizen_src/impl/chromium-efl-deps.gyp @@ -74,7 +74,6 @@ 'dependent_pkgs': [ 'capi-appfw-application', 'capi-system-info', - 'capi-system-sensor', 'capi-system-device', 'capi-location-manager', 'capi-media-audio-io', @@ -108,6 +107,7 @@ 'variables': { 'dependent_pkgs': [ 'efl-assist', + 'capi-system-sensor', 'ttrace', ], }, @@ -150,15 +150,6 @@ ], }, }], - # FIXME_youngsoo: This should be removed when TV upgrades - # to Tizen 2.3 or higher. - ['chromium_efl_tizen_version=="2.2.1"', { - 'direct_dependent_settings': { - 'include_dirs': [ - '<(sysroot)/usr/include/sensor', - ] - } - }], ], }, ], diff --git a/tizen_src/impl/chromium-efl.gyp b/tizen_src/impl/chromium-efl.gyp index 559a9134f6ad..8f22a795850a 100644 --- a/tizen_src/impl/chromium-efl.gyp +++ b/tizen_src/impl/chromium-efl.gyp @@ -129,8 +129,6 @@ 'browser/autofill/personal_data_manager_factory.h', 'browser/autofill/autofill_pref_store_efl.cc', 'browser/autofill/autofill_pref_store_efl.h', - 'browser/device_sensors/data_fetcher_impl_tizen.cc', - 'browser/device_sensors/data_fetcher_impl_tizen.h', 'browser/device_sensors/data_fetcher_shared_memory_tizen.cc', 'browser/disambiguation_popup_efl.cc', 'browser/disambiguation_popup_efl.h', @@ -164,10 +162,6 @@ 'browser/login_delegate_efl.h', 'browser/mime_override_manager_efl.cc', 'browser/mime_override_manager_efl.h', - 'browser/motion/wkext_motion.cc', - 'browser/motion/wkext_motion.h', - 'browser/motion/MotionUI.cc', - 'browser/motion/MotionUI.h', 'browser/navigation_policy_handler_efl.cc', 'browser/navigation_policy_handler_efl.h', 'browser/password_manager/password_manager_client_efl.cc', @@ -484,6 +478,12 @@ 'common/tts_utterance_request_efl.h', 'renderer/tts_dispatcher_efl.cc', 'renderer/tts_dispatcher_efl.h', + 'browser/device_sensors/data_fetcher_impl_tizen.cc', + 'browser/device_sensors/data_fetcher_impl_tizen.h', + 'browser/motion/wkext_motion.cc', + 'browser/motion/wkext_motion.h', + 'browser/motion/MotionUI.cc', + 'browser/motion/MotionUI.h', ], }], ['ewk_bringup==1', { diff --git a/tizen_src/impl/eweb_view.cc b/tizen_src/impl/eweb_view.cc index 1ddad602cda2..0a1da85a7fe5 100644 --- a/tizen_src/impl/eweb_view.cc +++ b/tizen_src/impl/eweb_view.cc @@ -41,7 +41,9 @@ #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/public/web/WebFindOptions.h" #include "ui/events/event_switches.h" +#if defined(OS_TIZEN_MOBILE) #include "browser/motion/wkext_motion.h" +#endif #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/screen.h" #include "devtools_delegate_efl.h" @@ -95,7 +97,7 @@ inline void SetDefaultStringIfNull(const char*& variable, } } -#ifdef OS_TIZEN +#if defined(OS_TIZEN_MOBILE) bool GetTiltZoomEnabled() { int motion_enabled = 0; @@ -399,7 +401,7 @@ void EWebView::Initialize() { geolocation_permission_cb_.reset(new WebViewGeolocationPermissionCallback(NULL, NULL)); unfocus_allow_cb_.reset(new WebViewUnfocusAllowCallback(NULL, NULL)); -#if defined(OS_TIZEN) +#if defined(OS_TIZEN_MOBILE) bool enable = GetTiltZoomEnabled(); if (enable) { evas_event_handler_->BindMotionEventHandlers(); diff --git a/tizen_src/impl/tizen_webview/public/tw_webview_evas_event_handler.cc b/tizen_src/impl/tizen_webview/public/tw_webview_evas_event_handler.cc index 418fce6a324d..5b4ae702103b 100644 --- a/tizen_src/impl/tizen_webview/public/tw_webview_evas_event_handler.cc +++ b/tizen_src/impl/tizen_webview/public/tw_webview_evas_event_handler.cc @@ -9,7 +9,9 @@ #include "tizen_webview/public/tw_touch_point.h" #include "eweb_view.h" +#if defined(OS_TIZEN_MOBILE) #include "browser/motion/wkext_motion.h" +#endif #include "browser/renderer_host/web_event_factory_efl.h" #include "browser/renderer_host/render_widget_host_view_efl.h" @@ -204,7 +206,7 @@ void WebViewEvasEventHandler::__OnMouseWheel(WebView* data, Evas *e, Evas_Object } void WebViewEvasEventHandler::__OnMotionEnable(WebView* data, Evas_Object *eo, void *event_info) { -#if defined(OS_TIZEN) +#if defined(OS_TIZEN_MOBILE) bool* enable = static_cast(event_info); wkext_motion_tilt_enable_set(data->AsEvasObject(), *enable, g_default_tilt_motion_sensitivity); #else @@ -217,7 +219,7 @@ void WebViewEvasEventHandler::__OnMotionMove(WebView* data, Evas_Object *eo, voi } void WebViewEvasEventHandler::__OnMotionZoom(WebView* data, Evas_Object *eo, void *event_info) { -#if defined(OS_TIZEN) +#if defined(OS_TIZEN_MOBILE) data->GetImpl()->rwhv()->makePinchZoom(event_info); #else DLOG(WARNING) << "Not Supported Event called in " << __PRETTY_FUNCTION__ ; @@ -356,9 +358,9 @@ bool WebViewEvasEventHandler::HandleEventDefault_TouchEvents(Touch_Event_Type ty webview_->HandleTouchEvents(type, points, evas_key_modifier_get(clip_data->evas)); -#ifdef OS_TIZEN - if (count >=2) { - if(type == TW_TOUCH_START) { +#if defined(OS_TIZEN_MOBILE) + if (count >= 2) { + if (type == TW_TOUCH_START) { LOG(ERROR) << " wkext_motion_tilt_start"; wkext_motion_tilt_start(evas_object_, &pt); } else if(type == TW_TOUCH_END) { diff --git a/tizen_src/packaging/chromium-efl.spec b/tizen_src/packaging/chromium-efl.spec index 88604092fa23..bb107ebe7253 100755 --- a/tizen_src/packaging/chromium-efl.spec +++ b/tizen_src/packaging/chromium-efl.spec @@ -42,7 +42,6 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(capi-system-sensor) BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(capi-system-device) BuildRequires: pkgconfig(capi-location-manager) @@ -79,6 +78,7 @@ BuildRequires: bzip2-devel BuildRequires: pkgconfig(efl-assist) BuildRequires: pkgconfig(ttrace) BuildRequires: pkgconfig(capi-network-connection) +BuildRequires: pkgconfig(capi-system-sensor) %else # TIZEN_PROFILE_TV BuildRequires: pkgconfig(audio-session-mgr) BuildRequires: pkgconfig(mm-session) -- 2.34.1