Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: Source/core/dom/BeforeUnloadEvent.h

Issue 22893051: Add support for BeforeUnloadEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test failures Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/BeforeUnloadEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/BeforeUnloadEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698