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

Unified Diff: third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp

Issue 2348333002: Revert of [sensors] Ambient light sensor bindings implementation (Closed)
Patch Set: Created 4 years, 3 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: third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
deleted file mode 100644
index aaede9f5011bdb801b1e32c4918817810245c91f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2016 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.
-
-#include "modules/sensor/AmbientLightSensor.h"
-
-#include "bindings/core/v8/ScriptPromise.h"
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "modules/sensor/AmbientLightSensorReading.h"
-
-using device::mojom::blink::SensorType;
-
-namespace blink {
-
-// static
-AmbientLightSensor* AmbientLightSensor::create(ExecutionContext* context, const SensorOptions& sensorOptions)
-{
- return new AmbientLightSensor(context, sensorOptions);
-}
-
-// static
-AmbientLightSensor* AmbientLightSensor::create(ExecutionContext* context)
-{
- return create(context, SensorOptions());
-}
-
-AmbientLightSensor::AmbientLightSensor(ExecutionContext* executionContext, const SensorOptions& sensorOptions)
- : Sensor(executionContext, sensorOptions, SensorType::AMBIENT_LIGHT)
-{
-}
-
-AmbientLightSensorReading* AmbientLightSensor::reading() const
-{
- return static_cast<AmbientLightSensorReading*>(Sensor::reading());
-}
-
-SensorReading* AmbientLightSensor::createSensorReading(SensorProxy* proxy)
-{
- return AmbientLightSensorReading::create(proxy);
-}
-
-auto AmbientLightSensor::createSensorConfig(const SensorOptions& options, const SensorConfiguration& defaultConfig) -> SensorConfigurationPtr
-{
- auto result = device::mojom::blink::SensorConfiguration::New();
- result->frequency = options.hasFrequency() ? options.frequency() : defaultConfig.frequency;
- return result;
-}
-
-DEFINE_TRACE(AmbientLightSensor)
-{
- Sensor::trace(visitor);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698