| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 Loading... |
| 28 | 28 |
| 29 #include "core/events/EventTarget.h" | 29 #include "core/events/EventTarget.h" |
| 30 #include "core/events/FocusEventInit.h" | 30 #include "core/events/FocusEventInit.h" |
| 31 #include "core/events/UIEvent.h" | 31 #include "core/events/UIEvent.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class FocusEvent final : public UIEvent { | 35 class FocusEvent final : public UIEvent { |
| 36 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
| 37 public: | 37 public: |
| 38 static PassRefPtrWillBeRawPtr<FocusEvent> create() | 38 static RawPtr<FocusEvent> create() |
| 39 { | 39 { |
| 40 return adoptRefWillBeNoop(new FocusEvent); | 40 return adoptRefWillBeNoop(new FocusEvent); |
| 41 } | 41 } |
| 42 | 42 |
| 43 static PassRefPtrWillBeRawPtr<FocusEvent> create(const AtomicString& type, b
ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int d
etail, EventTarget* relatedTarget, InputDeviceCapabilities* sourceCapabilities) | 43 static RawPtr<FocusEvent> create(const AtomicString& type, bool canBubble, b
ool cancelable, RawPtr<AbstractView> view, int detail, EventTarget* relatedTarge
t, InputDeviceCapabilities* sourceCapabilities) |
| 44 { | 44 { |
| 45 return adoptRefWillBeNoop(new FocusEvent(type, canBubble, cancelable, vi
ew, detail, relatedTarget, sourceCapabilities)); | 45 return new FocusEvent(type, canBubble, cancelable, view, detail, related
Target, sourceCapabilities); |
| 46 } | 46 } |
| 47 | 47 |
| 48 static PassRefPtrWillBeRawPtr<FocusEvent> create(const AtomicString& type, c
onst FocusEventInit& initializer) | 48 static RawPtr<FocusEvent> create(const AtomicString& type, const FocusEventI
nit& initializer) |
| 49 { | 49 { |
| 50 return adoptRefWillBeNoop(new FocusEvent(type, initializer)); | 50 return new FocusEvent(type, initializer); |
| 51 } | 51 } |
| 52 | 52 |
| 53 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 53 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
| 54 void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relate
dTarget; } | 54 void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relate
dTarget; } |
| 55 | 55 |
| 56 const AtomicString& interfaceName() const override; | 56 const AtomicString& interfaceName() const override; |
| 57 bool isFocusEvent() const override; | 57 bool isFocusEvent() const override; |
| 58 | 58 |
| 59 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; | 59 RawPtr<EventDispatchMediator> createMediator() override; |
| 60 | 60 |
| 61 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 FocusEvent(); | 64 FocusEvent(); |
| 65 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, int, EventTarget*, InputDeviceCapabilities*); | 65 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, RawPtr
<AbstractView>, int, EventTarget*, InputDeviceCapabilities*); |
| 66 FocusEvent(const AtomicString& type, const FocusEventInit&); | 66 FocusEvent(const AtomicString& type, const FocusEventInit&); |
| 67 | 67 |
| 68 RefPtrWillBeMember<EventTarget> m_relatedTarget; | 68 Member<EventTarget> m_relatedTarget; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 DEFINE_EVENT_TYPE_CASTS(FocusEvent); | 71 DEFINE_EVENT_TYPE_CASTS(FocusEvent); |
| 72 | 72 |
| 73 class FocusEventDispatchMediator final : public EventDispatchMediator { | 73 class FocusEventDispatchMediator final : public EventDispatchMediator { |
| 74 public: | 74 public: |
| 75 static PassRefPtrWillBeRawPtr<FocusEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<FocusEvent>); | 75 static RawPtr<FocusEventDispatchMediator> create(RawPtr<FocusEvent>); |
| 76 private: | 76 private: |
| 77 explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | 77 explicit FocusEventDispatchMediator(RawPtr<FocusEvent>); |
| 78 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } | 78 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } |
| 79 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 79 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| 83 | 83 |
| 84 #endif // FocusEvent_h | 84 #endif // FocusEvent_h |
| OLD | NEW |