{FocusIn,FocusOut,Focus,Blur}EventDispatchMediator should be in FocusEvent.cpp
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2013 00:20:17 +0000 (00:20 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2013 00:20:17 +0000 (00:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109265

Reviewed by Dimitri Glazkov.

Conventionally we put XXXEventDispatchMediator to XXXEvent.cpp.
We should move {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator to FocusEvent.cpp.

No tests. No change in behavior.

* dom/EventDispatchMediator.cpp:
* dom/EventDispatchMediator.h:
* dom/FocusEvent.cpp:
(WebCore::FocusEventDispatchMediator::create):
(WebCore):
(WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
(WebCore::FocusEventDispatchMediator::dispatchEvent):
(WebCore::BlurEventDispatchMediator::create):
(WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
(WebCore::BlurEventDispatchMediator::dispatchEvent):
(WebCore::FocusInEventDispatchMediator::create):
(WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
(WebCore::FocusInEventDispatchMediator::dispatchEvent):
(WebCore::FocusOutEventDispatchMediator::create):
(WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
(WebCore::FocusOutEventDispatchMediator::dispatchEvent):
* dom/FocusEvent.h:
(WebCore):
(FocusEventDispatchMediator):
(BlurEventDispatchMediator):
(FocusInEventDispatchMediator):
(FocusOutEventDispatchMediator):
* dom/UIEvent.cpp:
* dom/UIEvent.h:

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

Source/WebCore/ChangeLog
Source/WebCore/dom/EventDispatchMediator.cpp
Source/WebCore/dom/EventDispatchMediator.h
Source/WebCore/dom/FocusEvent.cpp
Source/WebCore/dom/FocusEvent.h
Source/WebCore/dom/UIEvent.cpp
Source/WebCore/dom/UIEvent.h

index 89585f0e1ebe6c05ba89fbfda157a7241c529dd9..ea7a493636a4bb38fba478379831dd672629a498 100644 (file)
@@ -1,3 +1,40 @@
+2013-02-08  Kentaro Hara  <haraken@chromium.org>
+
+        {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator should be in FocusEvent.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=109265
+
+        Reviewed by Dimitri Glazkov.
+
+        Conventionally we put XXXEventDispatchMediator to XXXEvent.cpp.
+        We should move {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator to FocusEvent.cpp.
+
+        No tests. No change in behavior.
+
+        * dom/EventDispatchMediator.cpp:
+        * dom/EventDispatchMediator.h:
+        * dom/FocusEvent.cpp:
+        (WebCore::FocusEventDispatchMediator::create):
+        (WebCore):
+        (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
+        (WebCore::FocusEventDispatchMediator::dispatchEvent):
+        (WebCore::BlurEventDispatchMediator::create):
+        (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
+        (WebCore::BlurEventDispatchMediator::dispatchEvent):
+        (WebCore::FocusInEventDispatchMediator::create):
+        (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
+        (WebCore::FocusInEventDispatchMediator::dispatchEvent):
+        (WebCore::FocusOutEventDispatchMediator::create):
+        (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
+        (WebCore::FocusOutEventDispatchMediator::dispatchEvent):
+        * dom/FocusEvent.h:
+        (WebCore):
+        (FocusEventDispatchMediator):
+        (BlurEventDispatchMediator):
+        (FocusInEventDispatchMediator):
+        (FocusOutEventDispatchMediator):
+        * dom/UIEvent.cpp:
+        * dom/UIEvent.h:
+
 2013-02-08  Jer Noble  <jer.noble@apple.com>
 
         Unreviewed build fix. MSVC (and other compilers) need a default: case in switch statement.
index d9db630c1409dd92faed7c39f290ccb1fb314d3a..e6837400704530ca5f5278d0f8b63194d419301b 100644 (file)
@@ -52,38 +52,4 @@ bool EventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
     return dispatcher->dispatchEvent(m_event.get());
 }
 
-PassRefPtr<FocusEventDispatchMediator> FocusEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
-{
-    return adoptRef(new FocusEventDispatchMediator(event, oldFocusedNode));
-}
-
-FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
-    : EventDispatchMediator(event)
-    , m_oldFocusedNode(oldFocusedNode)
-{
-}
-
-bool FocusEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
-{
-    dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
-    return EventDispatchMediator::dispatchEvent(dispatcher);
-}
-
-PassRefPtr<BlurEventDispatchMediator> BlurEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
-{
-    return adoptRef(new BlurEventDispatchMediator(event, newFocusedNode));
-}
-
-BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
-    : EventDispatchMediator(event)
-    , m_newFocusedNode(newFocusedNode)
-{
-}
-
-bool BlurEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
-{
-    dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
-    return EventDispatchMediator::dispatchEvent(dispatcher);
-}
-
 } // namespace WebCore
index 10c9ee37559cad25b6805e0edf027efc51ac7904..c334348740787ebcf3a18d0f6eb63f96be6a8fe2 100644 (file)
@@ -57,24 +57,6 @@ private:
     RefPtr<Event> m_event;
 };
 
-class FocusEventDispatchMediator : public EventDispatchMediator {
-public:
-    static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
-private:
-    FocusEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
-    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
-    RefPtr<Node> m_oldFocusedNode;
-};
-
-class BlurEventDispatchMediator : public EventDispatchMediator {
-public:
-    static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
-private:
-    BlurEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
-    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
-    RefPtr<Node> m_newFocusedNode;
-};
-
 } // namespace WebCore
 
 #endif // EventDispatchMediator_h
index d806001b2395efe08e9ff33fd22d19c2d7959e4f..a7ebb6a324d56af66113894733351bd6b60f7f9d 100644 (file)
@@ -27,7 +27,9 @@
 #include "FocusEvent.h"
 
 #include "Event.h"
+#include "EventDispatcher.h"
 #include "EventNames.h"
+#include "Node.h"
 
 namespace WebCore {
 
@@ -62,4 +64,72 @@ FocusEvent::FocusEvent(const AtomicString& type, const FocusEventInit& initializ
 {
 }
 
+PassRefPtr<FocusEventDispatchMediator> FocusEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
+{
+    return adoptRef(new FocusEventDispatchMediator(event, oldFocusedNode));
+}
+
+FocusEventDispatchMediator::FocusEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
+    : EventDispatchMediator(event)
+    , m_oldFocusedNode(oldFocusedNode)
+{
+}
+
+bool FocusEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
+{
+    dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
+    return EventDispatchMediator::dispatchEvent(dispatcher);
+}
+
+PassRefPtr<BlurEventDispatchMediator> BlurEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
+{
+    return adoptRef(new BlurEventDispatchMediator(event, newFocusedNode));
+}
+
+BlurEventDispatchMediator::BlurEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
+    : EventDispatchMediator(event)
+    , m_newFocusedNode(newFocusedNode)
+{
+}
+
+bool BlurEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
+{
+    dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
+    return EventDispatchMediator::dispatchEvent(dispatcher);
+}
+
+PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
+{
+    return adoptRef(new FocusInEventDispatchMediator(event, oldFocusedNode));
+}
+
+FocusInEventDispatchMediator::FocusInEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
+    : EventDispatchMediator(event)
+    , m_oldFocusedNode(oldFocusedNode)
+{
+}
+
+bool FocusInEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
+{
+    dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
+    return EventDispatchMediator::dispatchEvent(dispatcher);
+}
+
+PassRefPtr<FocusOutEventDispatchMediator> FocusOutEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
+{
+    return adoptRef(new FocusOutEventDispatchMediator(event, newFocusedNode));
+}
+
+FocusOutEventDispatchMediator::FocusOutEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
+    : EventDispatchMediator(event)
+    , m_newFocusedNode(newFocusedNode)
+{
+}
+
+bool FocusOutEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
+{
+    dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
+    return EventDispatchMediator::dispatchEvent(dispatcher);
+}
+
 } // namespace WebCore
index 1396cde9a08922a18698df1929d95751caf9d54b..9908f2524ab21c654f36aed187c3327da9e34703 100644 (file)
@@ -31,6 +31,8 @@
 
 namespace WebCore {
 
+class Node;
+
 struct FocusEventInit : public UIEventInit {
     FocusEventInit();
 
@@ -74,6 +76,42 @@ inline FocusEvent* toFocusEvent(Event* event)
     return static_cast<FocusEvent*>(event);
 }
 
+class FocusEventDispatchMediator : public EventDispatchMediator {
+public:
+    static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
+private:
+    FocusEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
+    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
+    RefPtr<Node> m_oldFocusedNode;
+};
+
+class BlurEventDispatchMediator : public EventDispatchMediator {
+public:
+    static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
+private:
+    BlurEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
+    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
+    RefPtr<Node> m_newFocusedNode;
+};
+
+class FocusInEventDispatchMediator : public EventDispatchMediator {
+public:
+    static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
+private:
+    explicit FocusInEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
+    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
+    RefPtr<Node> m_oldFocusedNode;
+};
+
+class FocusOutEventDispatchMediator : public EventDispatchMediator {
+public:
+    static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
+private:
+    explicit FocusOutEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
+    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
+    RefPtr<Node> m_newFocusedNode;
+};
+
 } // namespace WebCore
 
 #endif // FocusEvent_h
index b97ab00e2f6fed6a5fe4f93bda407519b35044c8..0e634e409473a7bd8cf93570cb9ba73498c5d4e3 100644 (file)
@@ -115,38 +115,4 @@ int UIEvent::which() const
     return 0;
 }
 
-PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
-{
-    return adoptRef(new FocusInEventDispatchMediator(event, oldFocusedNode));
-}
-
-FocusInEventDispatchMediator::FocusInEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
-    : EventDispatchMediator(event)
-    , m_oldFocusedNode(oldFocusedNode)
-{
-}
-
-bool FocusInEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
-{
-    dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
-    return EventDispatchMediator::dispatchEvent(dispatcher);
-}
-
-PassRefPtr<FocusOutEventDispatchMediator> FocusOutEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
-{
-    return adoptRef(new FocusOutEventDispatchMediator(event, newFocusedNode));
-}
-
-FocusOutEventDispatchMediator::FocusOutEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
-    : EventDispatchMediator(event)
-    , m_newFocusedNode(newFocusedNode)
-{
-}
-
-bool FocusOutEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
-{
-    dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
-    return EventDispatchMediator::dispatchEvent(dispatcher);
-}
-
 } // namespace WebCore
index fbd13098889d83aa11a93b6d1bc47ffda96ffd4f..0c90957efc63b4df65223c3d3c112a3fcca9f564 100644 (file)
@@ -84,24 +84,6 @@ private:
     int m_detail;
 };
 
-class FocusInEventDispatchMediator : public EventDispatchMediator {
-public:
-    static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
-private:
-    explicit FocusInEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
-    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
-    RefPtr<Node> m_oldFocusedNode;
-};
-
-class FocusOutEventDispatchMediator : public EventDispatchMediator {
-public:
-    static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
-private:
-    explicit FocusOutEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
-    virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
-    RefPtr<Node> m_newFocusedNode;
-};
-
 } // namespace WebCore
 
 #endif // UIEvent_h