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

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

Issue 870073003: Remove mouse 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
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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 * 24 *
25 */ 25 */
26 26
27 #include "sky/engine/config.h" 27 #include "sky/engine/config.h"
28 #include "sky/engine/core/events/NodeEventContext.h" 28 #include "sky/engine/core/events/NodeEventContext.h"
29 29
30 #include "sky/engine/core/dom/TouchList.h" 30 #include "sky/engine/core/dom/TouchList.h"
31 #include "sky/engine/core/events/Event.h" 31 #include "sky/engine/core/events/Event.h"
32 #include "sky/engine/core/events/FocusEvent.h" 32 #include "sky/engine/core/events/FocusEvent.h"
33 #include "sky/engine/core/events/MouseEvent.h"
34 #include "sky/engine/core/events/TouchEventContext.h" 33 #include "sky/engine/core/events/TouchEventContext.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
38 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext) 37 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext)
39 38
40 NodeEventContext::NodeEventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget > currentTarget) 39 NodeEventContext::NodeEventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget > currentTarget)
41 : m_node(node) 40 : m_node(node)
42 , m_currentTarget(currentTarget) 41 , m_currentTarget(currentTarget)
43 { 42 {
44 ASSERT(m_node); 43 ASSERT(m_node);
45 } 44 }
46 45
47 void NodeEventContext::handleLocalEvents(Event* event) const 46 void NodeEventContext::handleLocalEvents(Event* event) const
48 { 47 {
49 if (touchEventContext()) { 48 if (touchEventContext()) {
50 touchEventContext()->handleLocalEvents(event); 49 touchEventContext()->handleLocalEvents(event);
51 } else if (relatedTarget()) { 50 } else if (relatedTarget()) {
52 if (event->isMouseEvent()) { 51 if (event->isFocusEvent())
53 toMouseEvent(event)->setRelatedTarget(relatedTarget());
54 } else if (event->isFocusEvent()) {
55 toFocusEvent(event)->setRelatedTarget(relatedTarget()); 52 toFocusEvent(event)->setRelatedTarget(relatedTarget());
56 }
57 } 53 }
58 event->setTarget(target()); 54 event->setTarget(target());
59 event->setCurrentTarget(m_currentTarget.get()); 55 event->setCurrentTarget(m_currentTarget.get());
60 m_node->handleLocalEvents(event); 56 m_node->handleLocalEvents(event);
61 } 57 }
62 58
63 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698