diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/device_light/DeviceLightDispatcher.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/modules/device_light/DeviceLightDispatcher.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/device_light/DeviceLightDispatcher.h b/chromium/third_party/WebKit/Source/modules/device_light/DeviceLightDispatcher.h new file mode 100644 index 00000000000..d886079f090 --- /dev/null +++ b/chromium/third_party/WebKit/Source/modules/device_light/DeviceLightDispatcher.h @@ -0,0 +1,39 @@ +// 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 DeviceLightDispatcher_h +#define DeviceLightDispatcher_h + +#include "core/frame/DeviceEventDispatcherBase.h" +#include "public/platform/WebDeviceLightListener.h" +#include "wtf/RefPtr.h" + +namespace WebCore { + +class DeviceLightController; + +// This class listens to device light data and notifies all registered controllers. +class DeviceLightDispatcher FINAL : public DeviceEventDispatcherBase, public blink::WebDeviceLightListener { +public: + static DeviceLightDispatcher& instance(); + + double latestDeviceLightData() const; + + // Inherited from WebDeviceLightListener. + virtual void didChangeDeviceLight(double) OVERRIDE; + +private: + DeviceLightDispatcher(); + virtual ~DeviceLightDispatcher(); + + // Inherited from DeviceEventDispatcherBase. + virtual void startListening() OVERRIDE; + virtual void stopListening() OVERRIDE; + + double m_lastDeviceLightData; +}; + +} // namespace WebCore + +#endif // DeviceLightDispatcher_h |