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

Side by Side Diff: content/public/browser/sensor_manager_delegate.h

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ash files using content into ash/content 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
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/browser/sensor_manager_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "content/common/content_export.h"
11
12 template <typename T>
13 struct DefaultSingletonTraits;
14
15 namespace content {
16
17 typedef base::Callback<void(double, double, double)> OrientationDataXYZCallback;
flackr 2014/11/13 21:09:22 nit: double x, double y, double z Also s/Orientati
jonross 2014/11/17 21:54:10 Done.
18
19 // For platforms with a push API for accelerometer sensors this delegate can be
20 // implemented. Once notified to start fetching data, the callback provided can
21 // be used to send the data.
22 class CONTENT_EXPORT SensorManagerDelegate {
23 public:
24 SensorManagerDelegate();
25 virtual ~SensorManagerDelegate();
26
27 // Returns the SensorManagerDelegate singleton
28 static SensorManagerDelegate* GetInstance();
29
30 // True if a SensorManagerDelegate has been set.
31 static bool HasInstance();
32
33 // Allows platforms to provide a delegate.
34 static void SetDelegate(SensorManagerDelegate* delegate);
35
36 // Start processing accelerometer events for orientation. The values can be
37 // passed via |callback|
38 virtual void StartFetchingDeviceOrientationData(
39 const OrientationDataXYZCallback& callback) = 0;
40
41 // Stop processing accelerometer events for orientation.
42 virtual void StopFetchingDeviceOrientationData() = 0;
43
44 private:
45 static SensorManagerDelegate* delegate_;
46
47 DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegate);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/browser/sensor_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698