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

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

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Work in Adam's comments Created 6 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/device_light/DeviceLightController.h
diff --git a/Source/modules/device_light/DeviceLightController.h b/Source/modules/device_light/DeviceLightController.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3bcd72388b21ee4accb960d7945729ae4092aec
--- /dev/null
+++ b/Source/modules/device_light/DeviceLightController.h
@@ -0,0 +1,45 @@
+// 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 DeviceLightController_h
+#define DeviceLightController_h
+
+#include "core/dom/DocumentSupplementable.h"
+#include "core/events/Event.h"
+#include "core/frame/DOMWindowLifecycleObserver.h"
+#include "modules/device_light/DeviceLightEvent.h"
+#include "modules/device_orientation/DeviceSensorEventController.h"
+
+namespace WebCore {
+
+class DOMWindow;
+
+class DeviceLightController FINAL : public DeviceSensorEventController, public DocumentSupplement, public DOMWindowLifecycleObserver {
+
+public:
+ virtual ~DeviceLightController();
+
+ static const char* supplementName();
+ static DeviceLightController& from(Document&);
+
+ void didChangeDeviceLight(double);
+
+private:
+ explicit DeviceLightController(Document&);
+ virtual void registerWithDispatcher() OVERRIDE;
+ virtual void unregisterWithDispatcher() OVERRIDE;
+
+ // Inherited from DOMWindowLifecycleObserver.
+ virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
+ virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
+ virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE;
+
+ virtual bool hasLastData() OVERRIDE;
+ virtual PassRefPtr<Event> getLastEvent() OVERRIDE;
+ virtual bool isNullEvent(Event*) OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // DeviceLightController_h

Powered by Google App Engine
This is Rietveld 408576698