| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/device_sensors/device_light_event_pump.h" | 5 #include "content/renderer/device_sensors/device_light_event_pump.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "content/public/renderer/render_thread.h" | 8 #include "content/public/renderer/render_thread.h" |
| 9 #include "device/sensors/public/cpp/device_sensors_consts.h" | 9 #include "services/device/public/cpp/sensors/device_sensors_consts.h" |
| 10 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" | 10 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 // Default rate for firing of DeviceLight events. | 13 // Default rate for firing of DeviceLight events. |
| 14 const int kDefaultLightPumpDelayMicroseconds = | 14 const int kDefaultLightPumpDelayMicroseconds = |
| 15 base::Time::kMicrosecondsPerSecond / | 15 base::Time::kMicrosecondsPerSecond / |
| 16 device::kDefaultAmbientLightFrequencyHz; | 16 device::kDefaultAmbientLightFrequencyHz; |
| 17 } // namespace | 17 } // namespace |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 return reader_->Initialize(handle); | 56 return reader_->Initialize(handle); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void DeviceLightEventPump::SendFakeDataForTesting(void* fake_data) { | 59 void DeviceLightEventPump::SendFakeDataForTesting(void* fake_data) { |
| 60 double data = *static_cast<double*>(fake_data); | 60 double data = *static_cast<double*>(fake_data); |
| 61 | 61 |
| 62 listener()->DidChangeDeviceLight(data); | 62 listener()->DidChangeDeviceLight(data); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace content | 65 } // namespace content |
| OLD | NEW |