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