Remove support for consumable user gestures
authorjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jul 2013 19:24:19 +0000 (19:24 +0000)
committerjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jul 2013 19:24:19 +0000 (19:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118247

Reviewed by Geoffrey Garen.

Source/WebCore:

The features was not enabled on any port, and is meanwhile broken, so we
should delete it.

No new tests, just deleting dead code.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::increment):
(WebCore::AccessibilityNodeObject::decrement):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
* bindings/ScriptControllerBase.cpp:
(WebCore::ScriptController::executeScript):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
* dom/UserGestureIndicator.cpp:
(WebCore::isDefinite):
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::~UserGestureIndicator):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureIndicator::processingUserGesture):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::contextMenuItemSelected):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate):
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledURLNavigation::fire):
(WebCore::ScheduledURLNavigation::didStartTimer):
(WebCore::ScheduledRedirect::fire):
(WebCore::ScheduledRefresh::fire):
(WebCore::ScheduledHistoryNavigation::fire):
(WebCore::ScheduledFormSubmission::fire):
(WebCore::ScheduledFormSubmission::didStartTimer):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::fired):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::showModalDialog):
* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
* page/EventHandler.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::toggleMediaFullscreenState):
(WebCore::HitTestResult::enterFullscreenForVideo):

Source/WebKit/blackberry:

* WebKitSupport/NotificationManager.cpp:
(BlackBerry::WebKit::NotificationManager::notificationClicked):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::evaluate):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView sendEvent:isDrawRect:]):

Source/WebKit/qt:

* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::notificationClicked):

Source/WebKit/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):

Source/WebKit2:

* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::didClickNotification):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performFrameLoadURLRequest):
(WebKit::PluginView::evaluate):
* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit::WebContextMenuClient::searchWithGoogle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/bindings/ScriptControllerBase.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/dom/UserGestureIndicator.cpp
Source/WebCore/dom/UserGestureIndicator.h
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/page/DOMTimer.cpp
Source/WebCore/page/DOMTimer.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/NotificationManager.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp

index b8b9c02..6c92057 100644 (file)
@@ -1,3 +1,59 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        The features was not enabled on any port, and is meanwhile broken, so we
+        should delete it.
+
+        No new tests, just deleting dead code.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::increment):
+        (WebCore::AccessibilityNodeObject::decrement):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::press):
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::executeScript):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::executeScriptInWorld):
+        * dom/UserGestureIndicator.cpp:
+        (WebCore::isDefinite):
+        (WebCore::UserGestureIndicator::UserGestureIndicator):
+        (WebCore::UserGestureIndicator::~UserGestureIndicator):
+        * dom/UserGestureIndicator.h:
+        (WebCore::UserGestureIndicator::processingUserGesture):
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::openInNewTab):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::FrontendMenuProvider::contextMenuItemSelected):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::navigate):
+        * loader/NavigationScheduler.cpp:
+        (WebCore::ScheduledURLNavigation::fire):
+        (WebCore::ScheduledURLNavigation::didStartTimer):
+        (WebCore::ScheduledRedirect::fire):
+        (WebCore::ScheduledRefresh::fire):
+        (WebCore::ScheduledHistoryNavigation::fire):
+        (WebCore::ScheduledFormSubmission::fire):
+        (WebCore::ScheduledFormSubmission::didStartTimer):
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::DOMTimer):
+        (WebCore::DOMTimer::fired):
+        * page/DOMTimer.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::showModalDialog):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::clear):
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        * page/EventHandler.h:
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::toggleMediaFullscreenState):
+        (WebCore::HitTestResult::enterFullscreenForVideo):
+
 2013-07-01  Frédéric Wang  <fred.wang@free.fr>
 
         Add Support for mspace element
index 2c7392a..f0876e5 100644 (file)
@@ -1020,13 +1020,13 @@ void AccessibilityNodeObject::alterSliderValue(bool increase)
     
 void AccessibilityNodeObject::increment()
 {
-    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
     alterSliderValue(true);
 }
 
 void AccessibilityNodeObject::decrement()
 {
-    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
     alterSliderValue(false);
 }
 
index 1a932c2..ff473e6 100644 (file)
@@ -580,7 +580,7 @@ bool AccessibilityObject::press() const
     if (Frame* f = actionElem->document()->frame())
         f->loader()->resetMultipleFormSubmissionProtection();
     
-    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
     actionElem->accessKeyAction(true);
     return true;
 }
index 14a82e3..6482a2d 100644 (file)
@@ -60,7 +60,7 @@ bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
 
 ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
 {
-    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     return executeScript(ScriptSourceCode(script, m_frame->document()->url()));
 }
 
index 5734461..5666331 100644 (file)
@@ -457,7 +457,7 @@ void ScriptController::clearScriptObjects()
 
 ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture)
 {
-    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+    UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     ScriptSourceCode sourceCode(script, m_frame->document()->url());
 
     if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
index 8f0b54d..10e46ee 100644 (file)
 
 namespace WebCore {
 
-namespace {
-
-class GestureToken : public UserGestureToken {
-public:
-    static PassRefPtr<UserGestureToken> create() { return adoptRef(new GestureToken); }
-
-    virtual ~GestureToken() { }
-    virtual bool hasGestures() const OVERRIDE { return m_consumableGestures > 0; }
-
-    void addGesture() { m_consumableGestures++; }
-    bool consumeGesture()
-    {
-        if (!m_consumableGestures)
-            return false;
-        m_consumableGestures--;
-        return true;
-    }
-
-private:
-    GestureToken()
-        : m_consumableGestures(0)
-    {
-    }
-
-    size_t m_consumableGestures;
-};
-
-}
-
 static bool isDefinite(ProcessingUserGestureState state)
 {
-    return state == DefinitelyProcessingNewUserGesture || state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture;
+    return state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture;
 }
 
 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture;
-UserGestureIndicator* UserGestureIndicator::s_topmostIndicator = 0;
 
 UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state)
     : m_previousState(s_state)
 {
     // We overwrite s_state only if the caller is definite about the gesture state.
-    if (isDefinite(state)) {
-        if (!s_topmostIndicator) {
-            s_topmostIndicator = this;
-            m_token = GestureToken::create();
-        } else
-            m_token = s_topmostIndicator->currentToken();
+    if (isDefinite(state))
         s_state = state;
-    }
-
-    if (state == DefinitelyProcessingNewUserGesture)
-        static_cast<GestureToken*>(m_token.get())->addGesture();
-    else if (state == DefinitelyProcessingUserGesture && s_topmostIndicator == this)
-        static_cast<GestureToken*>(m_token.get())->addGesture();
-    ASSERT(isDefinite(s_state));
-}
-
-UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token)
-    : m_previousState(s_state)
-{
-    if (token && static_cast<GestureToken*>(token.get())->hasGestures()) {
-        if (!s_topmostIndicator) {
-            s_topmostIndicator = this;
-            m_token = token;
-        } else {
-            m_token = s_topmostIndicator->currentToken();
-            static_cast<GestureToken*>(m_token.get())->addGesture();
-            static_cast<GestureToken*>(token.get())->consumeGesture();
-        }
-        s_state = DefinitelyProcessingUserGesture;
-    }
-
     ASSERT(isDefinite(s_state));
 }
 
 UserGestureIndicator::~UserGestureIndicator()
 {
     s_state = m_previousState;
-    if (s_topmostIndicator == this)
-        s_topmostIndicator = 0;
     ASSERT(isDefinite(s_state));
 }
 
-bool UserGestureIndicator::processingUserGesture()
-{
-    return s_topmostIndicator && static_cast<GestureToken*>(s_topmostIndicator->currentToken())->hasGestures() && (s_state == DefinitelyProcessingNewUserGesture || s_state == DefinitelyProcessingUserGesture);
-}
-
-bool UserGestureIndicator::consumeUserGesture()
-{
-    if (!s_topmostIndicator)
-        return false;
-    return static_cast<GestureToken*>(s_topmostIndicator->currentToken())->consumeGesture();
-}
-
-UserGestureToken* UserGestureIndicator::currentToken()
-{
-    if (!s_topmostIndicator)
-        return 0;
-    return s_topmostIndicator->m_token.get();
-}
-
-UserGestureIndicatorDisabler::UserGestureIndicatorDisabler()
-    : m_savedState(UserGestureIndicator::s_state)
-    , m_savedIndicator(UserGestureIndicator::s_topmostIndicator)
-{
-    UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture;
-    UserGestureIndicator::s_topmostIndicator = 0;
-}
-
-UserGestureIndicatorDisabler::~UserGestureIndicatorDisabler()
-{
-    UserGestureIndicator::s_state = m_savedState;
-    UserGestureIndicator::s_topmostIndicator = m_savedIndicator;
-}
-
 }
index 4c29acb..1cd0339 100644 (file)
 #define UserGestureIndicator_h
 
 #include <wtf/Noncopyable.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class UserGestureIndicator;
-
 enum ProcessingUserGestureState {
-    DefinitelyProcessingNewUserGesture,
     DefinitelyProcessingUserGesture,
     PossiblyProcessingUserGesture,
     DefinitelyNotProcessingUserGesture
 };
 
-class UserGestureToken : public RefCounted<UserGestureToken> {
-public:
-    virtual ~UserGestureToken() { }
-    virtual bool hasGestures() const = 0;
-};
-
-class UserGestureIndicatorDisabler {
-    WTF_MAKE_NONCOPYABLE(UserGestureIndicatorDisabler);
-public:
-    UserGestureIndicatorDisabler();
-    ~UserGestureIndicatorDisabler();
-
-private:
-    ProcessingUserGestureState m_savedState;
-    UserGestureIndicator* m_savedIndicator;
-};
-
 class UserGestureIndicator {
     WTF_MAKE_NONCOPYABLE(UserGestureIndicator);
-    friend class UserGestureIndicatorDisabler;
 public:
-    static bool processingUserGesture();
-    static bool consumeUserGesture();
-    static UserGestureToken* currentToken();
+    static bool processingUserGesture() { return s_state == DefinitelyProcessingUserGesture; }
 
     explicit UserGestureIndicator(ProcessingUserGestureState);
-    explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
     ~UserGestureIndicator();
 
 
 private:
     static ProcessingUserGestureState s_state;
-    static UserGestureIndicator* s_topmostIndicator;
     ProcessingUserGestureState m_previousState;
-    RefPtr<UserGestureToken> m_token;
 };
 
 }
index 03eb46b..6701736 100644 (file)
@@ -208,7 +208,7 @@ void InspectorFrontendClientLocal::changeAttachedWindowWidth(unsigned width)
 
 void InspectorFrontendClientLocal::openInNewTab(const String& url)
 {
-    UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
     Page* page = m_inspectorController->inspectedPage();
     Frame* mainFrame = page->mainFrame();
     FrameLoadRequest request(mainFrame->document()->securityOrigin(), ResourceRequest(), "_blank");
index 9488080..275279f 100644 (file)
@@ -94,7 +94,7 @@ private:
     virtual void contextMenuItemSelected(ContextMenuItem* item)
     {
         if (m_frontendHost) {
-            UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+            UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
             int itemNumber = item->action() - ContextMenuItemBaseCustomTag;
 
             ScriptFunctionCall function(m_frontendApiObject, "contextMenuItemSelected");
index b23336b..896c871 100644 (file)
@@ -499,7 +499,7 @@ void InspectorPageAgent::reload(ErrorString*, const bool* const optionalIgnoreCa
 
 void InspectorPageAgent::navigate(ErrorString*, const String& url)
 {
-    UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
     Frame* frame = m_page->mainFrame();
     frame->loader()->changeLocation(frame->document()->securityOrigin(), frame->document()->completeURL(url), "", false, false);
 }
index 28cbd76..b7474c9 100644 (file)
@@ -107,7 +107,7 @@ protected:
 
     virtual void fire(Frame* frame)
     {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
         frame->loader()->changeLocation(m_securityOrigin.get(), KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), false);
     }
 
@@ -117,7 +117,7 @@ protected:
             return;
         m_haveToldClient = true;
 
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
         frame->loader()->clientRedirected(KURL(ParsedURLString, m_url), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
     }
 
@@ -158,7 +158,7 @@ public:
 
     virtual void fire(Frame* frame)
     {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
         bool refresh = equalIgnoringFragmentIdentifier(frame->document()->url(), KURL(ParsedURLString, url()));
         frame->loader()->changeLocation(securityOrigin(), KURL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), refresh);
     }
@@ -179,7 +179,7 @@ public:
 
     virtual void fire(Frame* frame)
     {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
         frame->loader()->changeLocation(securityOrigin(), KURL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), true);
     }
 };
@@ -194,7 +194,7 @@ public:
 
     virtual void fire(Frame* frame)
     {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
 
         if (!m_historySteps) {
             // Special case for go(0) from a frame -> reload only the frame
@@ -223,7 +223,7 @@ public:
 
     virtual void fire(Frame* frame)
     {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
 
         // The submitForm function will find a target frame before using the redirection timer.
         // Now that the timer has fired, we need to repeat the security check which normally is done when
@@ -243,7 +243,7 @@ public:
             return;
         m_haveToldClient = true;
 
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingNewUserGesture : DefinitelyNotProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
         frame->loader()->clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
     }
 
index aaa7887..5bb2511 100644 (file)
@@ -30,6 +30,7 @@
 #include "InspectorInstrumentation.h"
 #include "ScheduledAction.h"
 #include "ScriptExecutionContext.h"
+#include "UserGestureIndicator.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
 #include <wtf/StdLibExtras.h>
@@ -56,10 +57,8 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction>
     , m_nestingLevel(timerNestingLevel + 1)
     , m_action(action)
     , m_originalInterval(interval)
+    , m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
 {
-    if (shouldForwardUserGesture(interval, m_nestingLevel))
-        m_userGestureToken = UserGestureIndicator::currentToken();
-
     // Keep asking for the next id until we're given one that we don't already have.
     do {
         m_timeoutId = context->circularSequentialID();
@@ -109,8 +108,9 @@ void DOMTimer::fired()
     ScriptExecutionContext* context = scriptExecutionContext();
     timerNestingLevel = m_nestingLevel;
     ASSERT(!context->activeDOMObjectsAreSuspended());
+    UserGestureIndicator gestureIndicator(m_shouldForwardUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
-    UserGestureIndicator gestureIndicator(m_userGestureToken.release());
+    m_shouldForwardUserGesture = false;
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutId);
 
index 66d04d0..e6291e6 100644 (file)
@@ -28,7 +28,6 @@
 #define DOMTimer_h
 
 #include "SuspendableTimer.h"
-#include "UserGestureIndicator.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 
@@ -66,7 +65,7 @@ namespace WebCore {
         int m_nestingLevel;
         OwnPtr<ScheduledAction> m_action;
         int m_originalInterval;
-        RefPtr<UserGestureToken> m_userGestureToken;
+        bool m_shouldForwardUserGesture;
     };
 
 } // namespace WebCore
index 30bbb78..f7e78d2 100644 (file)
@@ -2002,7 +2002,6 @@ void DOMWindow::showModalDialog(const String& urlString, const String& dialogFea
         activeWindow, firstFrame, m_frame, function, functionContext);
     if (!dialogFrame)
         return;
-    UserGestureIndicatorDisabler disabler;
     dialogFrame->page()->chrome().runModal();
 }
 
index 2ffdb1b..8de250e 100644 (file)
@@ -82,6 +82,7 @@
 #include "StyleCachedImage.h"
 #include "TextEvent.h"
 #include "TextIterator.h"
+#include "UserGestureIndicator.h"
 #include "UserTypingGestureIndicator.h"
 #include "WheelEvent.h"
 #include "WindowsKeyboardCodes.h"
@@ -397,7 +398,6 @@ void EventHandler::clear()
     m_mousePositionIsUnknown = true;
     m_lastKnownMousePosition = IntPoint();
     m_lastKnownMouseGlobalPosition = IntPoint();
-    m_lastMouseDownUserGestureToken.clear();
     m_mousePressNode = 0;
     m_mousePressed = false;
     m_capturesDragging = false;
@@ -1514,7 +1514,6 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
 #endif
 
     UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
-    m_lastMouseDownUserGestureToken = gestureIndicator.currentToken();
 
     // FIXME (bug 68185): this call should be made at another abstraction layer
     m_frame->loader()->resetMultipleFormSubmissionProtection();
@@ -1880,12 +1879,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
         return true;
 #endif
 
-    OwnPtr<UserGestureIndicator> gestureIndicator;
-
-    if (m_lastMouseDownUserGestureToken)
-        gestureIndicator = adoptPtr(new UserGestureIndicator(m_lastMouseDownUserGestureToken.release()));
-    else
-        gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingUserGesture));
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
 
 #if ENABLE(PAN_SCROLLING)
     m_autoscrollController->handleMouseReleaseEvent(mouseEvent);
index 4cae557..a72eb97 100644 (file)
@@ -37,7 +37,6 @@
 #include "TextEventInputType.h"
 #include "TextGranularity.h"
 #include "Timer.h"
-#include "UserGestureIndicator.h"
 #include <wtf/Forward.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
@@ -464,7 +463,6 @@ private:
     IntPoint m_mouseDownPos; // In our view's coords.
     double m_mouseDownTimestamp;
     PlatformMouseEvent m_mouseDown;
-    RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken;
 
     RefPtr<Node> m_latchedWheelEventNode;
     bool m_widgetIsLatched;
index de8d4ce..8f2eb76 100644 (file)
@@ -416,7 +416,7 @@ void HitTestResult::toggleMediaFullscreenState() const
 #if ENABLE(VIDEO)
     if (HTMLMediaElement* mediaElement = this->mediaElement()) {
         if (mediaElement->isVideo() && mediaElement->supportsFullscreen()) {
-            UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+            UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
             mediaElement->toggleFullscreenState();
         }
     }
@@ -430,7 +430,7 @@ void HitTestResult::enterFullscreenForVideo() const
     if (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag)) {
         HTMLVideoElement* videoElt = static_cast<HTMLVideoElement*>(mediaElt);
         if (!videoElt->isFullscreen() && mediaElt->supportsFullscreen()) {
-            UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+            UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
             videoElt->enterFullscreen();
         }
     }
index 03d440c..90dfe92 100644 (file)
@@ -1,3 +1,13 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        * WebKitSupport/NotificationManager.cpp:
+        (BlackBerry::WebKit::NotificationManager::notificationClicked):
+
 2013-07-01  Kangil Han  <kangil.han@samsung.com>
 
         Adopt toHTMLTextAreaElement for code cleanup
index bf89409..24e7b2c 100644 (file)
@@ -180,7 +180,7 @@ void NotificationManager::notificationClicked(const String& notificationID)
         return;
 
     // Indicate that this event is being dispatched in reaction to a user's interaction with a platform notification.
-    UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
     notification->dispatchClickEvent();
 }
 
index b320d9b..1ebe299 100644 (file)
@@ -1,3 +1,15 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::evaluate):
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView sendEvent:isDrawRect:]):
+
 2013-06-27  Jer Noble  <jer.noble@apple.com>
 
         Audio in apps which embed WebViews is corrupted.
index 08fce5d..6cb8613 100644 (file)
@@ -873,7 +873,7 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri
     Strong<JSGlobalObject> globalObject(*pluginWorld()->vm(), frame->script()->globalObject(pluginWorld()));
     ExecState* exec = globalObject->globalExec();
 
-    UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+    UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     
     JSValue result = JSC::evaluate(exec, makeSource(script));
     
index bcafcaa..89e8cd0 100644 (file)
@@ -669,7 +669,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
     ASSERT(_eventHandler);
     {
         JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-        UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+        UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
         acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event);
     }
     [self didCallPlugInFunction];
index da94ef1..cc9ad15 100644 (file)
@@ -1,3 +1,13 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (WebCore::NotificationPresenterClientQt::notificationClicked):
+
 2013-06-27  Kangil Han  <kangil.han@samsung.com>
 
         Adopt is/toHTMLInputElement for code cleanup
index d52957e..600a871 100644 (file)
@@ -244,7 +244,7 @@ void NotificationPresenterClientQt::notificationClicked(NotificationWrapper* wra
     Notification* notification =  notificationForWrapper(wrapper);
     if (notification) {
         // Make sure clicks on notifications are treated as user gestures.
-        UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+        UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
         sendEvent(notification, eventNames().clickEvent);
     }
 }
index 740f9fd..c6e55e4 100644 (file)
@@ -1,3 +1,13 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        * WebCoreSupport/WebContextMenuClient.cpp:
+        (WebContextMenuClient::searchWithGoogle):
+
 2013-07-01  peavo@outlook.com  <peavo@outlook.com>
 
         [Curl] WebDownload init method is not implemented.
index f74bffb..b5291be 100644 (file)
@@ -121,7 +121,7 @@ void WebContextMenuClient::searchWithGoogle(const Frame* frame)
     url.append("&ie=UTF-8&oe=UTF-8");
 
     if (Page* page = frame->page()) {
-        UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+        UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
         page->mainFrame()->loader()->urlSelected(KURL(ParsedURLString, url), String(), 0, false, false, MaybeSendReferrer);
     }
 }
index cd29e43..608d3f3 100644 (file)
@@ -1,3 +1,18 @@
+2013-07-01  Jochen Eisinger  <jochen@chromium.org>
+
+        Remove support for consumable user gestures
+        https://bugs.webkit.org/show_bug.cgi?id=118247
+
+        Reviewed by Geoffrey Garen.
+
+        * WebProcess/Notifications/WebNotificationManager.cpp:
+        (WebKit::WebNotificationManager::didClickNotification):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::performFrameLoadURLRequest):
+        (WebKit::PluginView::evaluate):
+        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
+        (WebKit::WebContextMenuClient::searchWithGoogle):
+
 2013-06-27  Jer Noble  <jer.noble@apple.com>
 
         Audio in apps which embed WebViews is corrupted.
index b558c13..6423ff6 100644 (file)
@@ -249,7 +249,7 @@ void WebNotificationManager::didClickNotification(uint64_t notificationID)
         return;
 
     // Indicate that this event is being dispatched in reaction to a user's interaction with a platform notification.
-    UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+    UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
     notification->dispatchClickEvent();
 #else
     UNUSED_PARAM(notificationID);
index 27a7dcc..1836d93 100644 (file)
@@ -1097,7 +1097,7 @@ void PluginView::performFrameLoadURLRequest(URLRequest* request)
         return;
     }
 
-    UserGestureIndicator gestureIndicator(request->allowPopups() ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+    UserGestureIndicator gestureIndicator(request->allowPopups() ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
 
     // First, try to find a target frame.
     Frame* targetFrame = frame->loader()->findFrameForNavigation(request->target());
@@ -1370,7 +1370,7 @@ bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVari
     // protect the plug-in view from destruction.
     NPRuntimeObjectMap::PluginProtector pluginProtector(&m_npRuntimeObjectMap);
 
-    UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
+    UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     return m_npRuntimeObjectMap.evaluate(npObject, scriptString, result);
 }
 #endif
index 90a5148..4765e08 100644 (file)
@@ -85,7 +85,7 @@ void WebContextMenuClient::searchWithGoogle(const Frame* frame)
     String url = "http://www.google.com/search?q=" + encoded + "&ie=UTF-8&oe=UTF-8";
 
     if (Page* page = frame->page()) {
-        UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+        UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
         page->mainFrame()->loader()->urlSelected(KURL(ParsedURLString, url), String(), 0, false, false, MaybeSendReferrer);
     }
 }