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

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: 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/DeviceLightController.h
diff --git a/Source/modules/device_light/DeviceLightController.h b/Source/modules/device_light/DeviceLightController.h
new file mode 100644
index 0000000000000000000000000000000000000000..08791e118302ea66f01ee24c332a734f9fa0d5c8
--- /dev/null
+++ b/Source/modules/device_light/DeviceLightController.h
@@ -0,0 +1,47 @@
+// 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 "core/frame/DeviceSensorEventController.h"
+
+namespace WebCore {
+
+class DOMWindow;
+
+class DeviceLightController FINAL : public NoBaseWillBeGarbageCollectedFinalized<DeviceLightController>, public DeviceSensorEventController, public DocumentSupplement, public DOMWindowLifecycleObserver {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceLightController);
+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 PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE;
+ virtual bool isNullEvent(Event*) OVERRIDE;
+ virtual Document* document() OVERRIDE;
+
+ Document& m_document;
+};
+
+} // namespace WebCore
+
+#endif // DeviceLightController_h
« no previous file with comments | « Source/modules/device_light/DOMWindowDeviceLight.h ('k') | Source/modules/device_light/DeviceLightController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698