| 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 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "core/events/TouchEventContext.h" | 27 #include "core/events/TouchEventContext.h" |
| 28 | 28 |
| 29 #include "core/dom/TouchList.h" | 29 #include "core/dom/TouchList.h" |
| 30 #include "core/events/Event.h" | 30 #include "core/events/Event.h" |
| 31 #include "core/events/TouchEvent.h" | 31 #include "core/events/TouchEvent.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 PassRefPtrWillBeRawPtr<TouchEventContext> TouchEventContext::create() | 35 RawPtr<TouchEventContext> TouchEventContext::create() |
| 36 { | 36 { |
| 37 return adoptRefWillBeNoop(new TouchEventContext); | 37 return adoptRefWillBeNoop(new TouchEventContext); |
| 38 } | 38 } |
| 39 | 39 |
| 40 TouchEventContext::TouchEventContext() | 40 TouchEventContext::TouchEventContext() |
| 41 : m_touches(TouchList::create()) | 41 : m_touches(TouchList::create()) |
| 42 , m_targetTouches(TouchList::create()) | 42 , m_targetTouches(TouchList::create()) |
| 43 , m_changedTouches(TouchList::create()) | 43 , m_changedTouches(TouchList::create()) |
| 44 { | 44 { |
| 45 } | 45 } |
| 46 | 46 |
| 47 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(TouchEventContext) | |
| 48 | |
| 49 void TouchEventContext::handleLocalEvents(Event& event) const | 47 void TouchEventContext::handleLocalEvents(Event& event) const |
| 50 { | 48 { |
| 51 ASSERT(event.isTouchEvent()); | 49 ASSERT(event.isTouchEvent()); |
| 52 TouchEvent& touchEvent = toTouchEvent(event); | 50 TouchEvent& touchEvent = toTouchEvent(event); |
| 53 touchEvent.setTouches(m_touches); | 51 touchEvent.setTouches(m_touches); |
| 54 touchEvent.setTargetTouches(m_targetTouches); | 52 touchEvent.setTargetTouches(m_targetTouches); |
| 55 touchEvent.setChangedTouches(m_changedTouches); | 53 touchEvent.setChangedTouches(m_changedTouches); |
| 56 } | 54 } |
| 57 | 55 |
| 58 DEFINE_TRACE(TouchEventContext) | 56 DEFINE_TRACE(TouchEventContext) |
| 59 { | 57 { |
| 60 visitor->trace(m_touches); | 58 visitor->trace(m_touches); |
| 61 visitor->trace(m_targetTouches); | 59 visitor->trace(m_targetTouches); |
| 62 visitor->trace(m_changedTouches); | 60 visitor->trace(m_changedTouches); |
| 63 } | 61 } |
| 64 | 62 |
| 65 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |