| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 { | 49 { |
| 50 return adoptRefWillBeNoop(new FocusEvent(type, initializer)); | 50 return adoptRefWillBeNoop(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; |
| 60 |
| 59 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 FocusEvent(); | 64 FocusEvent(); |
| 63 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, int, EventTarget*); | 65 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, int, EventTarget*); |
| 64 FocusEvent(const AtomicString& type, const FocusEventInit&); | 66 FocusEvent(const AtomicString& type, const FocusEventInit&); |
| 65 | 67 |
| 66 RefPtrWillBeMember<EventTarget> m_relatedTarget; | 68 RefPtrWillBeMember<EventTarget> m_relatedTarget; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 DEFINE_EVENT_TYPE_CASTS(FocusEvent); | 71 DEFINE_EVENT_TYPE_CASTS(FocusEvent); |
| 70 | 72 |
| 71 class FocusEventDispatchMediator final : public EventDispatchMediator { | 73 class FocusEventDispatchMediator final : public EventDispatchMediator { |
| 72 public: | 74 public: |
| 73 static PassRefPtrWillBeRawPtr<FocusEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<FocusEvent>); | 75 static PassRefPtrWillBeRawPtr<FocusEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<FocusEvent>); |
| 74 private: | 76 private: |
| 75 explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | 77 explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); |
| 76 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } | 78 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } |
| 77 bool dispatchEvent(EventDispatcher&) const override; | 79 bool dispatchEvent(EventDispatcher&) const override; |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 class BlurEventDispatchMediator final : public EventDispatchMediator { | |
| 81 public: | |
| 82 static PassRefPtrWillBeRawPtr<BlurEventDispatchMediator> create(PassRefPtrWi
llBeRawPtr<FocusEvent>); | |
| 83 private: | |
| 84 explicit BlurEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | |
| 85 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } | |
| 86 bool dispatchEvent(EventDispatcher&) const override; | |
| 87 }; | |
| 88 | |
| 89 class FocusInEventDispatchMediator final : public EventDispatchMediator { | |
| 90 public: | |
| 91 static PassRefPtrWillBeRawPtr<FocusInEventDispatchMediator> create(PassRefPt
rWillBeRawPtr<FocusEvent>); | |
| 92 private: | |
| 93 explicit FocusInEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | |
| 94 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } | |
| 95 bool dispatchEvent(EventDispatcher&) const override; | |
| 96 }; | |
| 97 | |
| 98 class FocusOutEventDispatchMediator final : public EventDispatchMediator { | |
| 99 public: | |
| 100 static PassRefPtrWillBeRawPtr<FocusOutEventDispatchMediator> create(PassRefP
trWillBeRawPtr<FocusEvent>); | |
| 101 private: | |
| 102 explicit FocusOutEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | |
| 103 FocusEvent& event() const { return static_cast<FocusEvent&>(EventDispatchMed
iator::event()); } | |
| 104 bool dispatchEvent(EventDispatcher&) const override; | |
| 105 }; | |
| 106 | |
| 107 } // namespace blink | 82 } // namespace blink |
| 108 | 83 |
| 109 #endif // FocusEvent_h | 84 #endif // FocusEvent_h |
| OLD | NEW |