Index: Source/core/dom/BeforeUnloadEvent.h |
diff --git a/Source/core/dom/BeforeUnloadEvent.h b/Source/core/dom/BeforeUnloadEvent.h |
index c3be3467cf9dd7bd24a2b5969b36786f35fb2b60..a76ad521bcad1e932f1cf3ed0df91668740d8b47 100644 |
--- a/Source/core/dom/BeforeUnloadEvent.h |
+++ b/Source/core/dom/BeforeUnloadEvent.h |
@@ -3,6 +3,7 @@ |
* Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
* Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. |
+ * Copyright (C) 2013 Samsung Electronics. |
* |
* This library is free software; you can redistribute it and/or |
* modify it under the terms of the GNU Library General Public |
@@ -25,28 +26,37 @@ |
#define BeforeUnloadEvent_h |
#include "core/dom/Event.h" |
+#include "core/dom/EventNames.h" |
namespace WebCore { |
- class BeforeUnloadEvent : public Event { |
- public: |
- virtual ~BeforeUnloadEvent(); |
+class BeforeUnloadEvent : public Event { |
+public: |
+ virtual ~BeforeUnloadEvent(); |
- static PassRefPtr<BeforeUnloadEvent> create() |
- { |
- return adoptRef(new BeforeUnloadEvent); |
- } |
+ static PassRefPtr<BeforeUnloadEvent> create() |
+ { |
+ return adoptRef(new BeforeUnloadEvent); |
+ } |
- virtual bool storesResultAsString() const; |
- virtual void storeResult(const String&); |
+ virtual bool isBeforeUnloadEvent() const OVERRIDE; |
- String result() const { return m_result; } |
+ void setReturnValue(const String& returnValue) { m_returnValue = returnValue; } |
+ String returnValue() const { return m_returnValue; } |
- private: |
- BeforeUnloadEvent(); |
+ virtual const AtomicString& interfaceName() const OVERRIDE { return eventNames().interfaceForBeforeUnloadEvent; } |
- String m_result; |
- }; |
+private: |
+ BeforeUnloadEvent(); |
+ |
+ String m_returnValue; |
+}; |
+ |
+inline BeforeUnloadEvent* toBeforeUnloadEvent(Event* event) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!event || event->isBeforeUnloadEvent()); |
+ return static_cast<BeforeUnloadEvent*>(event); |
+} |
} // namespace WebCore |