Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: sky/engine/core/events/NodeEventContext.h

Issue 868133003: Remove touch events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/events/EventTypeNames.in ('k') | sky/engine/core/events/NodeEventContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
28 #define SKY_ENGINE_CORE_EVENTS_NODEEVENTCONTEXT_H_ 28 #define SKY_ENGINE_CORE_EVENTS_NODEEVENTCONTEXT_H_
29 29
30 #include "sky/engine/core/events/TreeScopeEventContext.h" 30 #include "sky/engine/core/events/TreeScopeEventContext.h"
31 #include "sky/engine/wtf/PassRefPtr.h" 31 #include "sky/engine/wtf/PassRefPtr.h"
32 #include "sky/engine/wtf/RefPtr.h" 32 #include "sky/engine/wtf/RefPtr.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class EventTarget; 36 class EventTarget;
37 class Node; 37 class Node;
38 class TouchEventContext;
39 38
40 class NodeEventContext { 39 class NodeEventContext {
41 ALLOW_ONLY_INLINE_ALLOCATION(); 40 ALLOW_ONLY_INLINE_ALLOCATION();
42 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext); 41 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext);
43 public: 42 public:
44 // FIXME: Use ContainerNode instead of Node. 43 // FIXME: Use ContainerNode instead of Node.
45 NodeEventContext(PassRefPtr<Node>, PassRefPtr<EventTarget> currentTarget); 44 NodeEventContext(PassRefPtr<Node>, PassRefPtr<EventTarget> currentTarget);
46 45
47 Node* node() const { return m_node.get(); } 46 Node* node() const { return m_node.get(); }
48 47
49 void setTreeScopeEventContext(PassRefPtr<TreeScopeEventContext> prpTreeScope EventContext) { m_treeScopeEventContext = prpTreeScopeEventContext; } 48 void setTreeScopeEventContext(PassRefPtr<TreeScopeEventContext> prpTreeScope EventContext) { m_treeScopeEventContext = prpTreeScopeEventContext; }
50 TreeScopeEventContext& treeScopeEventContext() { ASSERT(m_treeScopeEventCont ext); return *m_treeScopeEventContext; } 49 TreeScopeEventContext& treeScopeEventContext() { ASSERT(m_treeScopeEventCont ext); return *m_treeScopeEventContext; }
51 50
52 EventTarget* target() const { return m_treeScopeEventContext->target(); } 51 EventTarget* target() const { return m_treeScopeEventContext->target(); }
53 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related Target(); } 52 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related Target(); }
54 TouchEventContext* touchEventContext() const { return m_treeScopeEventContex t->touchEventContext(); }
55 53
56 bool currentTargetSameAsTarget() const { return m_currentTarget.get() == tar get(); } 54 bool currentTargetSameAsTarget() const { return m_currentTarget.get() == tar get(); }
57 void handleLocalEvents(Event*) const; 55 void handleLocalEvents(Event*) const;
58 56
59 private: 57 private:
60 RefPtr<Node> m_node; 58 RefPtr<Node> m_node;
61 RefPtr<EventTarget> m_currentTarget; 59 RefPtr<EventTarget> m_currentTarget;
62 RefPtr<TreeScopeEventContext> m_treeScopeEventContext; 60 RefPtr<TreeScopeEventContext> m_treeScopeEventContext;
63 }; 61 };
64 62
65 } // namespace blink 63 } // namespace blink
66 64
67 #if !ENABLE(OILPAN) 65 #if !ENABLE(OILPAN)
68 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::NodeEventContext); 66 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::NodeEventContext);
69 #else 67 #else
70 namespace WTF { 68 namespace WTF {
71 template <> struct VectorTraits<blink::NodeEventContext> : SimpleClassVectorTrai ts<blink::NodeEventContext> { 69 template <> struct VectorTraits<blink::NodeEventContext> : SimpleClassVectorTrai ts<blink::NodeEventContext> {
72 static const bool needsDestruction = false; 70 static const bool needsDestruction = false;
73 }; 71 };
74 } 72 }
75 #endif 73 #endif
76 74
77 #endif // SKY_ENGINE_CORE_EVENTS_NODEEVENTCONTEXT_H_ 75 #endif // SKY_ENGINE_CORE_EVENTS_NODEEVENTCONTEXT_H_
OLDNEW
« no previous file with comments | « sky/engine/core/events/EventTypeNames.in ('k') | sky/engine/core/events/NodeEventContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698