Chromium Code Reviews| Index: ash/content/accelerometer/sensor_manager_delegate_chromeos.h |
| diff --git a/ash/content/accelerometer/sensor_manager_delegate_chromeos.h b/ash/content/accelerometer/sensor_manager_delegate_chromeos.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..77d8602ddc7767467ba0dd3eec30d0d5504ca054 |
| --- /dev/null |
| +++ b/ash/content/accelerometer/sensor_manager_delegate_chromeos.h |
| @@ -0,0 +1,42 @@ |
| +// 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 ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |
| +#define ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |
| + |
| +#include "content/public/browser/sensor_manager_delegate_chromeos.h" |
| + |
| +#include "ash/accelerometer/accelerometer_observer.h" |
| +#include "base/callback.h" |
| +#include "base/macros.h" |
| + |
| +namespace ash { |
| + |
| +// Chrome OS implementation of the Device Orientation API. Responsible for |
| +// observing accelerometer events, and notifying content::SensorManagerChromeOS. |
| +class SensorManagerDelegateChromeOS |
|
Charlie Reis
2014/12/10 01:02:41
This class name should probably be prefixed with A
|
| + : public AccelerometerObserver, |
| + public content::SensorManagerDelegateChromeOS { |
| + public: |
| + SensorManagerDelegateChromeOS(); |
| + ~SensorManagerDelegateChromeOS() override; |
| + |
| + // AccelerometerObserver: |
| + void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override; |
| + |
| + // content::SensorManagerDelegateChromeOS: |
| + void StartFetchingDeviceOrientationData( |
| + const content::OrientationDataCallback& callback) override; |
| + void StopFetchingDeviceOrientationData() override; |
| + |
| + private: |
| + // Callback to direct accelerometer events to. |
| + content::OrientationDataCallback orientation_callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |