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 21 matching lines...) Expand all Loading... |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 class Node; | 34 class Node; |
35 | 35 |
36 struct FocusEventInit : public UIEventInit { | 36 struct FocusEventInit : public UIEventInit { |
37 FocusEventInit(); | 37 FocusEventInit(); |
38 | 38 |
39 RefPtr<EventTarget> relatedTarget; | 39 RefPtr<EventTarget> relatedTarget; |
40 }; | 40 }; |
41 | 41 |
42 class FocusEvent : public UIEvent { | 42 class FocusEvent FINAL : public UIEvent { |
43 public: | 43 public: |
44 static PassRefPtr<FocusEvent> create() | 44 static PassRefPtr<FocusEvent> create() |
45 { | 45 { |
46 return adoptRef(new FocusEvent); | 46 return adoptRef(new FocusEvent); |
47 } | 47 } |
48 | 48 |
49 static PassRefPtr<FocusEvent> create(const AtomicString& type, bool canBubbl
e, bool cancelable, PassRefPtr<AbstractView> view, int detail, EventTarget* rela
tedTarget) | 49 static PassRefPtr<FocusEvent> create(const AtomicString& type, bool canBubbl
e, bool cancelable, PassRefPtr<AbstractView> view, int detail, EventTarget* rela
tedTarget) |
50 { | 50 { |
51 return adoptRef(new FocusEvent(type, canBubble, cancelable, view, detail
, relatedTarget)); | 51 return adoptRef(new FocusEvent(type, canBubble, cancelable, view, detail
, relatedTarget)); |
52 } | 52 } |
53 | 53 |
54 static PassRefPtr<FocusEvent> create(const AtomicString& type, const FocusEv
entInit& initializer) | 54 static PassRefPtr<FocusEvent> create(const AtomicString& type, const FocusEv
entInit& initializer) |
55 { | 55 { |
56 return adoptRef(new FocusEvent(type, initializer)); | 56 return adoptRef(new FocusEvent(type, initializer)); |
57 } | 57 } |
58 | 58 |
59 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 59 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
60 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget;
return m_relatedTarget.get(); } | 60 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget;
return m_relatedTarget.get(); } |
61 void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relate
dTarget; } | 61 void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relate
dTarget; } |
62 | 62 |
63 virtual const AtomicString& interfaceName() const; | 63 virtual const AtomicString& interfaceName() const OVERRIDE; |
64 virtual bool isFocusEvent() const; | 64 virtual bool isFocusEvent() const OVERRIDE; |
65 | 65 |
66 private: | 66 private: |
67 FocusEvent(); | 67 FocusEvent(); |
68 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, int, EventTarget*); | 68 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, int, EventTarget*); |
69 FocusEvent(const AtomicString& type, const FocusEventInit&); | 69 FocusEvent(const AtomicString& type, const FocusEventInit&); |
70 | 70 |
71 RefPtr<EventTarget> m_relatedTarget; | 71 RefPtr<EventTarget> m_relatedTarget; |
72 }; | 72 }; |
73 | 73 |
74 DEFINE_EVENT_TYPE_CASTS(FocusEvent); | 74 DEFINE_EVENT_TYPE_CASTS(FocusEvent); |
75 | 75 |
76 class FocusEventDispatchMediator : public EventDispatchMediator { | 76 class FocusEventDispatchMediator FINAL : public EventDispatchMediator { |
77 public: | 77 public: |
78 static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtr<FocusEvent>)
; | 78 static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtr<FocusEvent>)
; |
79 private: | 79 private: |
80 explicit FocusEventDispatchMediator(PassRefPtr<FocusEvent>); | 80 explicit FocusEventDispatchMediator(PassRefPtr<FocusEvent>); |
81 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 81 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
82 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 82 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
83 }; | 83 }; |
84 | 84 |
85 class BlurEventDispatchMediator : public EventDispatchMediator { | 85 class BlurEventDispatchMediator FINAL : public EventDispatchMediator { |
86 public: | 86 public: |
87 static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtr<FocusEvent>); | 87 static PassRefPtr<BlurEventDispatchMediator> create(PassRefPtr<FocusEvent>); |
88 private: | 88 private: |
89 explicit BlurEventDispatchMediator(PassRefPtr<FocusEvent>); | 89 explicit BlurEventDispatchMediator(PassRefPtr<FocusEvent>); |
90 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 90 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
91 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 91 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
92 }; | 92 }; |
93 | 93 |
94 class FocusInEventDispatchMediator : public EventDispatchMediator { | 94 class FocusInEventDispatchMediator FINAL : public EventDispatchMediator { |
95 public: | 95 public: |
96 static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<FocusEvent
>); | 96 static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<FocusEvent
>); |
97 private: | 97 private: |
98 explicit FocusInEventDispatchMediator(PassRefPtr<FocusEvent>); | 98 explicit FocusInEventDispatchMediator(PassRefPtr<FocusEvent>); |
99 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 99 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
100 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 100 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
101 }; | 101 }; |
102 | 102 |
103 class FocusOutEventDispatchMediator : public EventDispatchMediator { | 103 class FocusOutEventDispatchMediator FINAL : public EventDispatchMediator { |
104 public: | 104 public: |
105 static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<FocusEven
t>); | 105 static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<FocusEven
t>); |
106 private: | 106 private: |
107 explicit FocusOutEventDispatchMediator(PassRefPtr<FocusEvent>); | 107 explicit FocusOutEventDispatchMediator(PassRefPtr<FocusEvent>); |
108 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 108 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
109 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 109 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
110 }; | 110 }; |
111 | 111 |
112 } // namespace WebCore | 112 } // namespace WebCore |
113 | 113 |
114 #endif // FocusEvent_h | 114 #endif // FocusEvent_h |
OLD | NEW |