| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/events/EventTarget.h" | 29 #include "core/events/EventTarget.h" |
| 30 #include "core/events/UIEvent.h" | 30 #include "core/events/UIEvent.h" |
| 31 | 31 |
| 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 RefPtrWillBeMember<EventTarget> relatedTarget; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class FocusEvent FINAL : public UIEvent { | 42 class FocusEvent FINAL : public UIEvent { |
| 43 public: | 43 public: |
| 44 static PassRefPtrWillBeRawPtr<FocusEvent> create() | 44 static PassRefPtrWillBeRawPtr<FocusEvent> create() |
| 45 { | 45 { |
| 46 return adoptRefWillBeNoop(new FocusEvent); | 46 return adoptRefWillBeNoop(new FocusEvent); |
| 47 } | 47 } |
| 48 | 48 |
| 49 static PassRefPtrWillBeRawPtr<FocusEvent> create(const AtomicString& type, b
ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int d
etail, EventTarget* relatedTarget) | 49 static PassRefPtrWillBeRawPtr<FocusEvent> create(const AtomicString& type, b
ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int d
etail, EventTarget* relatedTarget) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 63 virtual const AtomicString& interfaceName() const OVERRIDE; | 63 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 64 virtual bool isFocusEvent() const OVERRIDE; | 64 virtual bool isFocusEvent() const OVERRIDE; |
| 65 | 65 |
| 66 virtual void trace(Visitor*) OVERRIDE; | 66 virtual void trace(Visitor*) OVERRIDE; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 FocusEvent(); | 69 FocusEvent(); |
| 70 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, int, EventTarget*); | 70 FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, int, EventTarget*); |
| 71 FocusEvent(const AtomicString& type, const FocusEventInit&); | 71 FocusEvent(const AtomicString& type, const FocusEventInit&); |
| 72 | 72 |
| 73 RefPtr<EventTarget> m_relatedTarget; | 73 RefPtrWillBeMember<EventTarget> m_relatedTarget; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 DEFINE_EVENT_TYPE_CASTS(FocusEvent); | 76 DEFINE_EVENT_TYPE_CASTS(FocusEvent); |
| 77 | 77 |
| 78 class FocusEventDispatchMediator FINAL : public EventDispatchMediator { | 78 class FocusEventDispatchMediator FINAL : public EventDispatchMediator { |
| 79 public: | 79 public: |
| 80 static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtrWillBeRawPtr<
FocusEvent>); | 80 static PassRefPtr<FocusEventDispatchMediator> create(PassRefPtrWillBeRawPtr<
FocusEvent>); |
| 81 private: | 81 private: |
| 82 explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | 82 explicit FocusEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); |
| 83 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 83 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 107 static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtrWillBeRawP
tr<FocusEvent>); | 107 static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtrWillBeRawP
tr<FocusEvent>); |
| 108 private: | 108 private: |
| 109 explicit FocusOutEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); | 109 explicit FocusOutEventDispatchMediator(PassRefPtrWillBeRawPtr<FocusEvent>); |
| 110 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } | 110 FocusEvent* event() const { return static_cast<FocusEvent*>(EventDispatchMed
iator::event()); } |
| 111 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 111 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace WebCore | 114 } // namespace WebCore |
| 115 | 115 |
| 116 #endif // FocusEvent_h | 116 #endif // FocusEvent_h |
| OLD | NEW |