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

Side by Side Diff: chrome/browser/chromeos/dbus/sensors_source.h

Issue 8400034: chromeos: Add a stub implementation for SensorsSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
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 CHROME_BROWSER_CHROMEOS_DBUS_SENSORS_SOURCE_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_SENSORS_SOURCE_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "content/browser/browser_thread.h"
10
11 #include <string>
12
13 namespace dbus {
14 class Bus;
15 class ObjectProxy;
16 class Signal;
17 } // namespace
18
19 namespace chromeos {
20
21 // Creates and manages a dbus signal receiver for device orientation changes,
22 // and eventually receives data for other motion-related sensors.
23 class SensorsSource {
24 public:
25 // Creates an inactive sensors source.
26 SensorsSource();
27 virtual ~SensorsSource();
28
29 // Initializes this sensor source and begins listening for signals.
30 // Returns true on success.
31 void Init(dbus::Bus* bus);
32
33 private:
34 // Called by dbus:: in when an orientation change signal is received.
35 void OrientationChangedReceived(dbus::Signal* signal);
36
37 // Called by dbus:: when the orientation change signal is initially connected.
38 void OrientationChangedConnected(const std::string& interface_name,
39 const std::string& signal_name,
40 bool success);
41
42 dbus::ObjectProxy* sensors_proxy_;
43 base::WeakPtrFactory<SensorsSource> weak_ptr_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(SensorsSource);
46 };
47
48 } // namespace chromeos
49
50 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SENSORS_SOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dbus/sensors_client.cc ('k') | chrome/browser/chromeos/dbus/sensors_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698