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

Side by Side Diff: content/browser/sensors/provider.h

Issue 7455002: Revert 93094 - Initial sensor event provider for testing views screen rotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/sensors/provider.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 (c) 2011 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_BROWSER_SENSORS_PROVIDER_H_
6 #define CONTENT_BROWSER_SENSORS_PROVIDER_H_
7 #pragma once
8
9 #include "content/common/sensors_listener.h"
10
11 namespace sensors {
12
13 // The sensors API will unify various types of sensor data into a set of
14 // channels, each of which provides change events and periodic updates.
15 //
16 // This version of the API is intended only to support the experimental screen
17 // rotation code and is not for general use. In particular, the final listener
18 // will declare generic |OnSensorChanged| and |OnSensorUpdated| methods, rather
19 // than the special-purpose |OnScreenOrientationChanged|.
20 //
21 // TODO(cwolfe): Finish defining the initial set of channels and replace this
22 // with the generic sensor provider.
23 //
24 class Provider {
25 public:
26 static Provider* GetInstance();
27
28 // Adds a sensor listener. The listener will receive callbacks to indicate
29 // sensor changes and updates until it is removed.
30 //
31 // This method may be called in any thread. Callbacks on a listener will
32 // always be executed in the thread which added that listener.
33 virtual void AddListener(Listener* listener) = 0;
34
35 // Removes a sensor listener.
36 //
37 // This method must be called in the same thread which added the listener.
38 // If the listener is not currently subscribed, this method may be called in
39 // any thread.
40 virtual void RemoveListener(Listener* listener) = 0;
41
42 // Broadcasts a change to the coarse screen orientation.
43 //
44 // This method may be called in any thread.
45 virtual void ScreenOrientationChanged(const ScreenOrientation& change) = 0;
46
47 protected:
48 Provider();
49 virtual ~Provider();
50
51 DISALLOW_COPY_AND_ASSIGN(Provider);
52 };
53
54 } // namespace sensors
55
56 #endif // CONTENT_BROWSER_SENSORS_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/sensors/provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698