| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2014 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "wtf/RefPtr.h" | 33 #include "wtf/RefPtr.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class EventTarget; | 37 class EventTarget; |
| 38 class Node; | 38 class Node; |
| 39 class TouchEventContext; | 39 class TouchEventContext; |
| 40 | 40 |
| 41 class CORE_EXPORT NodeEventContext { | 41 class CORE_EXPORT NodeEventContext { |
| 42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 43 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext); | |
| 44 public: | 43 public: |
| 45 // FIXME: Use ContainerNode instead of Node. | 44 // FIXME: Use ContainerNode instead of Node. |
| 46 NodeEventContext(PassRefPtrWillBeRawPtr<Node>, PassRefPtrWillBeRawPtr<EventT
arget> currentTarget); | 45 NodeEventContext(RawPtr<Node>, RawPtr<EventTarget> currentTarget); |
| 47 DECLARE_TRACE(); | 46 DECLARE_TRACE(); |
| 48 | 47 |
| 49 Node* node() const { return m_node.get(); } | 48 Node* node() const { return m_node.get(); } |
| 50 | 49 |
| 51 void setTreeScopeEventContext(PassRefPtrWillBeRawPtr<TreeScopeEventContext>
prpTreeScopeEventContext) { m_treeScopeEventContext = prpTreeScopeEventContext;
} | 50 void setTreeScopeEventContext(RawPtr<TreeScopeEventContext> prpTreeScopeEven
tContext) { m_treeScopeEventContext = prpTreeScopeEventContext; } |
| 52 TreeScopeEventContext& treeScopeEventContext() { ASSERT(m_treeScopeEventCont
ext); return *m_treeScopeEventContext; } | 51 TreeScopeEventContext& treeScopeEventContext() { ASSERT(m_treeScopeEventCont
ext); return *m_treeScopeEventContext; } |
| 53 | 52 |
| 54 EventTarget* target() const { return m_treeScopeEventContext->target(); } | 53 EventTarget* target() const { return m_treeScopeEventContext->target(); } |
| 55 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related
Target(); } | 54 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related
Target(); } |
| 56 TouchEventContext* touchEventContext() const { return m_treeScopeEventContex
t->touchEventContext(); } | 55 TouchEventContext* touchEventContext() const { return m_treeScopeEventContex
t->touchEventContext(); } |
| 57 | 56 |
| 58 bool currentTargetSameAsTarget() const { return m_currentTarget.get() == tar
get(); } | 57 bool currentTargetSameAsTarget() const { return m_currentTarget.get() == tar
get(); } |
| 59 void handleLocalEvents(Event&) const; | 58 void handleLocalEvents(Event&) const; |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 RefPtrWillBeMember<Node> m_node; | 61 Member<Node> m_node; |
| 63 RefPtrWillBeMember<EventTarget> m_currentTarget; | 62 Member<EventTarget> m_currentTarget; |
| 64 RefPtrWillBeMember<TreeScopeEventContext> m_treeScopeEventContext; | 63 Member<TreeScopeEventContext> m_treeScopeEventContext; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 } // namespace blink | 66 } // namespace blink |
| 68 | 67 |
| 69 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::NodeEventContext); | 68 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::NodeEventContext); |
| 70 | 69 |
| 71 #endif // NodeEventContext_h | 70 #endif // NodeEventContext_h |
| OLD | NEW |