From fe1f625264d40681518a0078586bdaf477e1daba Mon Sep 17 00:00:00 2001 From: Sanghyup Lee Date: Wed, 20 Mar 2013 10:57:50 +0900 Subject: [PATCH] Rename feature that Beep sound when click link [Title] Rename feature that Beep sound when click link [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Rename feature that Beep sound when click link Change-Id: I3cf37762672020d8714b8dc713595950d11e420e Conflicts: Source/WebCore/PlatformTizen.cmake --- Source/WTF/wtf/Platform.h | 2 +- Source/WebCore/PlatformTizen.cmake | 1 + Source/WebCore/html/HTMLAnchorElement.cpp | 7 ---- Source/WebCore/html/HTMLButtonElement.cpp | 7 ---- Source/WebCore/html/HTMLInputElement.cpp | 7 ---- Source/WebCore/page/EventHandler.cpp | 10 +++++- Source/WebCore/platform/Sound.h | 3 -- Source/WebCore/platform/efl/SoundEfl.cpp | 13 ------- .../WebCore/platform/efl/tizen/TizenLinkEffect.cpp | 42 ++++++++++++++++++++++ .../WebCore/platform/efl/tizen/TizenLinkEffect.h | 42 ++++++++++++++++++++++ 10 files changed, 95 insertions(+), 39 deletions(-) create mode 100644 Source/WebCore/platform/efl/tizen/TizenLinkEffect.cpp create mode 100644 Source/WebCore/platform/efl/tizen/TizenLinkEffect.h diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index a994739..7613692 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -370,7 +370,7 @@ #define ENABLE_TIZEN_CONTEXT_MENU_TEMPORARY_FIX 1 /* Michal Pakula(m.pakula@samsung.com) : Temporary hack to prevent from crash when calling context menu on editable fiedld */ #define ENABLE_TIZEN_CONTEXT_MENU_SELECT 1 /* Michal Pakula(m.pakula@samsung.com) : Adds Select All and Select options to context menu */ #define ENABLE_TIZEN_MEDIA_CONTROL_USER_AGENT_SHEET 1 /* Gyuyoung Kim(gyuyoung.kim@samsung.com) Add media control ui sheet for TIZEN */ -#define ENABLE_TIZEN_LINK_SOUND 1 /* Sanghyup Lee(sh53.lee@samsung.com) For beep on click link*/ +#define ENABLE_TIZEN_LINK_EFFECT 1 /* Sanghyup Lee(sh53.lee@samsung.com) To beep when click link*/ #define ENABLE_TIZEN_DAILY_UPVERSIONING 1 /* Krzysztof Czech(k.czech@samsung.com) : Used for fixing building errors while doing daily upversioning, should be deleted before merging to master*/ diff --git a/Source/WebCore/PlatformTizen.cmake b/Source/WebCore/PlatformTizen.cmake index 7be971b..5bbbb42 100755 --- a/Source/WebCore/PlatformTizen.cmake +++ b/Source/WebCore/PlatformTizen.cmake @@ -123,6 +123,7 @@ LIST(APPEND WebCore_SOURCES platform/efl/tizen/ScrollbarThemeTizen.cpp platform/efl/tizen/SSLKeyGeneratorTizen.cpp platform/efl/tizen/SSLPrivateKeyStoreTizen.cpp + platform/efl/tizen/TizenLinkEffect.cpp platform/efl/tizen/TizenProfiler.cpp platform/efl/tizen/TizenExtensibleAPI.cpp diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp index 63a6e83..5680a38 100644 --- a/Source/WebCore/html/HTMLAnchorElement.cpp +++ b/Source/WebCore/html/HTMLAnchorElement.cpp @@ -42,10 +42,6 @@ #include "SecurityPolicy.h" #include "Settings.h" -#if ENABLE(TIZEN_LINK_SOUND) -#include "Sound.h" -#endif - namespace WebCore { using namespace HTMLNames; @@ -166,9 +162,6 @@ void HTMLAnchorElement::defaultEventHandler(Event* event) } if (isLinkClick(event) && treatLinkAsLiveForEventType(eventType(event))) { -#if ENABLE(TIZEN_LINK_SOUND) - feedbackPlay(); -#endif handleClick(event); return; } diff --git a/Source/WebCore/html/HTMLButtonElement.cpp b/Source/WebCore/html/HTMLButtonElement.cpp index 4c65836..ecb4a21 100644 --- a/Source/WebCore/html/HTMLButtonElement.cpp +++ b/Source/WebCore/html/HTMLButtonElement.cpp @@ -36,10 +36,6 @@ #include "ScriptEventListener.h" #include -#if ENABLE(TIZEN_LINK_SOUND) -#include "Sound.h" -#endif - namespace WebCore { using namespace HTMLNames; @@ -116,9 +112,6 @@ void HTMLButtonElement::parseAttribute(const Attribute& attribute) void HTMLButtonElement::defaultEventHandler(Event* event) { if (event->type() == eventNames().DOMActivateEvent && !disabled()) { -#if ENABLE(ETIZEN_LINK_SOUND) - feedbackPlay(); -#endif if (form() && m_type == SUBMIT) { m_isActivatedSubmit = true; form()->prepareForSubmission(event); diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 40480b4..13f1849 100755 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -72,10 +72,6 @@ #include "TouchEvent.h" #endif -#if ENABLE(TIZEN_LINK_SOUND) -#include "Sound.h" -#endif - using namespace std; namespace WebCore { @@ -1157,9 +1153,6 @@ void HTMLInputElement::defaultEventHandler(Event* evt) } if (evt->isMouseEvent() && evt->type() == eventNames().mousedownEvent) { -#if ENABLE(TIZEN_LINK_SOUND) - feedbackPlay(); -#endif m_inputType->handleMouseDownEvent(static_cast(evt)); if (evt->defaultHandled()) return; diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index e0d0ee2..5d35bbc 100755 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -109,6 +109,10 @@ #include "TouchList.h" #endif +#if ENABLE(TIZEN_LINK_EFFECT) +#include "TizenLinkEffect.h" +#endif + namespace WebCore { using namespace HTMLNames; @@ -498,8 +502,12 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR { m_frame->document()->updateLayoutIgnorePendingStylesheets(); Node* innerNode = targetNode(event); - if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect)) + if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect)) { +#if ENABLE(TIZEN_LINK_EFFECT) + TizenLinkEffect::playLinkEffect(); +#endif return false; + } // Extend the selection if the Shift key is down, unless the click is in a link. bool extendSelection = event.event().shiftKey() && !event.isOverLink(); diff --git a/Source/WebCore/platform/Sound.h b/Source/WebCore/platform/Sound.h index d78bb56..534129b 100644 --- a/Source/WebCore/platform/Sound.h +++ b/Source/WebCore/platform/Sound.h @@ -27,9 +27,6 @@ #define Sound_h namespace WebCore { -#if ENABLE(TIZEN_LINK_SOUND) - void feedbackPlay(); -#endif void systemBeep(); diff --git a/Source/WebCore/platform/efl/SoundEfl.cpp b/Source/WebCore/platform/efl/SoundEfl.cpp index 19a56ee..cb63db9 100644 --- a/Source/WebCore/platform/efl/SoundEfl.cpp +++ b/Source/WebCore/platform/efl/SoundEfl.cpp @@ -34,21 +34,8 @@ #include #endif -#if ENABLE(TIZEN_LINK_SOUND) -#include "feedback.h" -#endif - namespace WebCore { -#if ENABLE(TIZEN_LINK_SOUND) -void feedbackPlay() -{ - feedback_initialize(); - feedback_play(FEEDBACK_PATTERN_TAP); - feedback_deinitialize(); -} -#endif - void systemBeep() { // FIXME: The ecore_x_bell() uses XBell() which works in the current Display. diff --git a/Source/WebCore/platform/efl/tizen/TizenLinkEffect.cpp b/Source/WebCore/platform/efl/tizen/TizenLinkEffect.cpp new file mode 100644 index 0000000..2b8222a --- /dev/null +++ b/Source/WebCore/platform/efl/tizen/TizenLinkEffect.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 Samsung Electronics. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + */ + +#include "config.h" +#include "TizenLinkEffect.h" + +#include "feedback.h" + +#if ENABLE(TIZEN_LINK_EFFECT) +namespace WebCore { + +void TizenLinkEffect::playLinkEffect() +{ + feedback_initialize(); + feedback_play(FEEDBACK_PATTERN_TAP); + feedback_deinitialize(); +} + +} +#endif \ No newline at end of file diff --git a/Source/WebCore/platform/efl/tizen/TizenLinkEffect.h b/Source/WebCore/platform/efl/tizen/TizenLinkEffect.h new file mode 100644 index 0000000..c9119a2 --- /dev/null +++ b/Source/WebCore/platform/efl/tizen/TizenLinkEffect.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 Samsung Electronics. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + */ + +#ifndef TizenLinkEffect_h +#define TizenLinkEffect_h + +#if ENABLE(TIZEN_LINK_EFFECT) + +namespace WebCore { + +class TizenLinkEffect { +public: + static void playLinkEffect(); +}; + +} // namespace WebCore + +#endif //ENABLE(TIZEN_LINK_EFFECT) + +#endif // TizenLinkEffect_h \ No newline at end of file -- 2.7.4