OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2009 Apple 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 22 matching lines...) Expand all Loading... |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 struct BeforeLoadEventInit : public EventInit { | 35 struct BeforeLoadEventInit : public EventInit { |
36 BeforeLoadEventInit() | 36 BeforeLoadEventInit() |
37 { | 37 { |
38 }; | 38 }; |
39 | 39 |
40 String url; | 40 String url; |
41 }; | 41 }; |
42 | 42 |
43 class BeforeLoadEvent : public Event { | 43 class BeforeLoadEvent FINAL : public Event { |
44 public: | 44 public: |
45 static PassRefPtr<BeforeLoadEvent> create() | 45 static PassRefPtr<BeforeLoadEvent> create() |
46 { | 46 { |
47 return adoptRef(new BeforeLoadEvent); | 47 return adoptRef(new BeforeLoadEvent); |
48 } | 48 } |
49 | 49 |
50 static PassRefPtr<BeforeLoadEvent> create(const String& url) | 50 static PassRefPtr<BeforeLoadEvent> create(const String& url) |
51 { | 51 { |
52 return adoptRef(new BeforeLoadEvent(url)); | 52 return adoptRef(new BeforeLoadEvent(url)); |
53 } | 53 } |
54 | 54 |
55 static PassRefPtr<BeforeLoadEvent> create(const AtomicString& type, const Be
foreLoadEventInit& initializer) | 55 static PassRefPtr<BeforeLoadEvent> create(const AtomicString& type, const Be
foreLoadEventInit& initializer) |
56 { | 56 { |
57 return adoptRef(new BeforeLoadEvent(type, initializer)); | 57 return adoptRef(new BeforeLoadEvent(type, initializer)); |
58 } | 58 } |
59 | 59 |
60 const String& url() const { return m_url; } | 60 const String& url() const { return m_url; } |
61 | 61 |
62 virtual const AtomicString& interfaceName() const { return EventNames::Befor
eLoadEvent; } | 62 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam
es::BeforeLoadEvent; } |
63 | 63 |
64 private: | 64 private: |
65 BeforeLoadEvent() | 65 BeforeLoadEvent() |
66 { | 66 { |
67 ScriptWrappable::init(this); | 67 ScriptWrappable::init(this); |
68 } | 68 } |
69 | 69 |
70 explicit BeforeLoadEvent(const String& url) | 70 explicit BeforeLoadEvent(const String& url) |
71 : Event(EventTypeNames::beforeload, false, true) | 71 : Event(EventTypeNames::beforeload, false, true) |
72 , m_url(url) | 72 , m_url(url) |
73 { | 73 { |
74 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
75 } | 75 } |
76 | 76 |
77 BeforeLoadEvent(const AtomicString& type, const BeforeLoadEventInit& initial
izer) | 77 BeforeLoadEvent(const AtomicString& type, const BeforeLoadEventInit& initial
izer) |
78 : Event(type, initializer) | 78 : Event(type, initializer) |
79 , m_url(initializer.url) | 79 , m_url(initializer.url) |
80 { | 80 { |
81 ScriptWrappable::init(this); | 81 ScriptWrappable::init(this); |
82 } | 82 } |
83 | 83 |
84 String m_url; | 84 String m_url; |
85 }; | 85 }; |
86 | 86 |
87 } // namespace WebCore | 87 } // namespace WebCore |
88 | 88 |
89 #endif // BeforeLoadEvent_h | 89 #endif // BeforeLoadEvent_h |
OLD | NEW |