OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 EventContext::EventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> curren
tTarget, PassRefPtr<EventTarget> target) | 37 EventContext::EventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> curren
tTarget, PassRefPtr<EventTarget> target) |
38 : m_node(node) | 38 : m_node(node) |
39 , m_currentTarget(currentTarget) | 39 , m_currentTarget(currentTarget) |
40 , m_target(target) | 40 , m_target(target) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 void EventContext::defaultEventHandler(Event* event) const | |
45 { | |
46 event->setTarget(m_target.get()); | |
47 event->setCurrentTarget(m_currentTarget.get()); | |
48 m_node->defaultEventHandler(event); | |
49 } | |
50 | |
51 void EventContext::handleLocalEvents(Event* event) const | 44 void EventContext::handleLocalEvents(Event* event) const |
52 { | 45 { |
53 event->setTarget(m_target.get()); | 46 event->setTarget(m_target.get()); |
54 event->setCurrentTarget(m_currentTarget.get()); | 47 event->setCurrentTarget(m_currentTarget.get()); |
55 m_node->handleLocalEvents(event); | 48 m_node->handleLocalEvents(event); |
56 } | 49 } |
57 | 50 |
58 } | 51 } |
OLD | NEW |