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

Unified Diff: Source/modules/device_light/DeviceLightEvent.h

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits Created 6 years, 7 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/device_light/DeviceLightEvent.h
diff --git a/Source/modules/device_light/DeviceLightEvent.h b/Source/modules/device_light/DeviceLightEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..e75eef3f609216b60bcb0d8369630bc19ce90d90
--- /dev/null
+++ b/Source/modules/device_light/DeviceLightEvent.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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 DeviceLightEvent_h
+#define DeviceLightEvent_h
+
+#include "core/events/Event.h"
+#include "platform/heap/Handle.h"
+
+namespace WebCore {
+
+struct DeviceLightEventInit : public EventInit {
+ DeviceLightEventInit()
+ : value(std::numeric_limits<double>::infinity())
+ {
+ bubbles = true;
+ };
+
+ double value;
+};
+
+class DeviceLightEvent FINAL : public Event {
+public:
+ virtual ~DeviceLightEvent();
+
+ static PassRefPtrWillBeRawPtr<DeviceLightEvent> create()
+ {
+ return adoptRefWillBeNoop(new DeviceLightEvent);
+ }
+ static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, double value)
+ {
+ return adoptRefWillBeNoop(new DeviceLightEvent(eventType, value));
+ }
+ static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, const DeviceLightEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new DeviceLightEvent(eventType, initializer));
+ }
+
+ double value() const { return m_value; }
+
+ virtual const AtomicString& interfaceName() const OVERRIDE;
+
+private:
+ DeviceLightEvent();
+ DeviceLightEvent(const AtomicString& eventType, double value);
+ DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer);
+
+ double m_value;
+};
+
+DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == EventNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent);
+
+} // namespace WebCore
+
+#endif // DeviceLightEvent_h
« no previous file with comments | « Source/modules/device_light/DeviceLightDispatcher.cpp ('k') | Source/modules/device_light/DeviceLightEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698