Rename feature that Beep sound when click link
authorSanghyup Lee <sh53.lee@samsung.com>
Wed, 20 Mar 2013 01:57:50 +0000 (10:57 +0900)
committerSanghyup Lee <sh53.lee@samsung.com>
Tue, 26 Mar 2013 07:21:35 +0000 (16:21 +0900)
[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
Source/WebCore/PlatformTizen.cmake
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/platform/Sound.h
Source/WebCore/platform/efl/SoundEfl.cpp
Source/WebCore/platform/efl/tizen/TizenLinkEffect.cpp [new file with mode: 0644]
Source/WebCore/platform/efl/tizen/TizenLinkEffect.h [new file with mode: 0644]

index a994739..7613692 100755 (executable)
 #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*/
 
index 7be971b..5bbbb42 100755 (executable)
@@ -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
 
index 63a6e83..5680a38 100644 (file)
 #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;
         }
index 4c65836..ecb4a21 100644 (file)
 #include "ScriptEventListener.h"
 #include <wtf/StdLibExtras.h>
 
-#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);
index 40480b4..13f1849 100755 (executable)
 #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<MouseEvent*>(evt));
         if (evt->defaultHandled())
             return;
index e0d0ee2..5d35bbc 100755 (executable)
 #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();
index d78bb56..534129b 100644 (file)
@@ -27,9 +27,6 @@
 #define Sound_h
 
 namespace WebCore {
-#if ENABLE(TIZEN_LINK_SOUND)
-    void feedbackPlay();
-#endif
 
     void systemBeep();
 
index 19a56ee..cb63db9 100644 (file)
 #include <Ecore_X.h>
 #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 (file)
index 0000000..2b8222a
--- /dev/null
@@ -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 (file)
index 0000000..c9119a2
--- /dev/null
@@ -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