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

Unified Diff: Source/modules/presentation/DefaultPresentationStartEvent.h

Issue 974993002: [Presentation API] Added the DefaultPresentationStart event and parsing of the default presentation… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Default implementation for the new WebPresentationClient method Created 5 years, 10 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
Index: Source/modules/presentation/DefaultPresentationStartEvent.h
diff --git a/Source/modules/presentation/DefaultPresentationStartEvent.h b/Source/modules/presentation/DefaultPresentationStartEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..1a7064b3915bfa612f7c833f5ca0cf62fe08266b
--- /dev/null
+++ b/Source/modules/presentation/DefaultPresentationStartEvent.h
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DefaultPresentationStartEvent_h
+#define DefaultPresentationStartEvent_h
+
+#include "modules/EventModules.h"
+#include "modules/presentation/DefaultPresentationStartEventInit.h"
+#include "modules/presentation/PresentationSession.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+// DefaultPresentationStartEvent object definition corresponding to the event
+// IDL from the Presentation API,
+// see https://code.google.com/p/chromium/issues/detail?id=459001 for details.
Peter Beverloo 2015/03/03 21:19:24 I don't think this comment is useful at all. Inste
whywhat 2015/03/05 18:41:46 Done.
+class DefaultPresentationStartEvent final : public Event {
mark a. foltz 2015/03/05 19:44:11 Why "DefaultPresentationStart?" The purpose of th
whywhat 2015/03/05 20:46:02 Yes, I think using session is more consistent. How
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ virtual ~DefaultPresentationStartEvent();
+
+ static PassRefPtrWillBeRawPtr<DefaultPresentationStartEvent> create()
+ {
+ return adoptRefWillBeNoop(new DefaultPresentationStartEvent);
+ }
+ static PassRefPtrWillBeRawPtr<DefaultPresentationStartEvent> create(const AtomicString& eventType, PresentationSession* session)
+ {
+ return adoptRefWillBeNoop(new DefaultPresentationStartEvent(eventType, session));
+ }
+ static PassRefPtrWillBeRawPtr<DefaultPresentationStartEvent> create(const AtomicString& eventType, const DefaultPresentationStartEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new DefaultPresentationStartEvent(eventType, initializer));
+ }
+
+ PresentationSession& session() { return *m_session; }
Peter Beverloo 2015/03/03 21:19:24 You probably want to gracefully handle m_session b
whywhat 2015/03/05 18:41:46 Done.
+
+ virtual const AtomicString& interfaceName() const override;
+
+private:
+ DefaultPresentationStartEvent();
+ DefaultPresentationStartEvent(const AtomicString& eventType, PresentationSession*);
+ DefaultPresentationStartEvent(const AtomicString& eventType, const DefaultPresentationStartEventInit& initializer);
+
+ Persistent<PresentationSession> m_session;
+};
+
+DEFINE_TYPE_CASTS(DefaultPresentationStartEvent, Event, event, event->interfaceName() == EventNames::DefaultPresentationStartEvent, event.interfaceName() == EventNames::DefaultPresentationStartEvent);
+
+} // namespace blink
+
+#endif // DefaultPresentationStartEvent_h

Powered by Google App Engine
This is Rietveld 408576698