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

Side by Side Diff: ash/accelerometer/sensor_manager_delegate_chromeos.h

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove implementation details from content/public/browser Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
6 #define ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
7
8 #include "content/public/browser/sensor_manager_delegate.h"
9
10 #include "ash/accelerometer/accelerometer_observer.h"
11 #include "base/callback.h"
12 #include "base/macros.h"
13
14 namespace ash {
15
16 // Chrome OS implementation of the Device Orientation API. Responsible for
17 // observing accelerometer events, and notifying content::SensorManagerChromeOS.
18 class SensorManagerDelegateChromeOS : public AccelerometerObserver,
19 public content::SensorManagerDelegate {
20 public:
21 SensorManagerDelegateChromeOS();
22 ~SensorManagerDelegateChromeOS() override;
23
24 // AccelerometerObserver:
25 void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override;
26
27 // content::SensorManagerDelegate:
28 void StartFetchingDeviceOrientationData(
29 const base::Callback<void(double, double, double)>& callback) override;
30 void StopFetchingDeviceOrientationData() override;
31
32 private:
33 // Callback to direct accelerometer events to.
34 base::Callback<void(double, double, double)> orientation_callback_;
35
36 // True if actively observing events.
37 bool observing_accelerometer_;
flackr 2014/11/13 00:07:34 This should be the same as orientation_callback_.i
jonross 2014/11/13 01:34:05 Done.
38
39 DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS);
40 };
41
42 } // namespace ash
43
44 #endif // ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698