Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_CHROMEOS_SENSORS_SOURCE_CHROMEOS_H_ | |
| 6 #define CONTENT_BROWSER_CHROMEOS_SENSORS_SOURCE_CHROMEOS_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 namespace dbus { | |
| 13 class Bus; | |
| 14 class ObjectProxy; | |
| 15 class Signal; | |
| 16 } // namespace | |
| 17 | |
| 18 namespace sensors { | |
|
sky
2011/09/12 21:21:19
I'm not familiar with sensors, and it doesn't look
cwolfe
2011/09/12 22:15:55
Whoops. Fixed the macros.
I added content/browser
| |
| 19 | |
| 20 // Creates and manages a dbus signal receiver for device orientation changes, | |
| 21 // and eventually receives data for other motion-related sensors. | |
| 22 class SensorsSourceChromeos | |
| 23 : public base::RefCountedThreadSafe<SensorsSourceChromeos> { | |
| 24 public: | |
| 25 // Creates an inactive sensors source. | |
| 26 SensorsSourceChromeos(); | |
| 27 | |
| 28 // Initializes this sensor source and begins listening for signals. | |
| 29 // Returns true if the | |
|
sky
2011/09/12 21:21:19
update comment.
cwolfe
2011/09/12 22:15:55
Done.
| |
| 30 // | |
| 31 // The sensor source currently performs DBus operations using | |
| 32 // BrowserThread::IO, which have been started before calling this method. | |
| 33 bool Init(); | |
| 34 | |
| 35 // Shuts down this sensors source and the underlying DBus connection. | |
| 36 void Stop(); | |
| 37 | |
| 38 private: | |
| 39 friend class base::RefCountedThreadSafe<SensorsSourceChromeos>; | |
| 40 virtual ~SensorsSourceChromeos(); | |
| 41 | |
| 42 // Called by dbus:: when an orientation change signal is received. | |
| 43 void OrientationChangedReceived(dbus::Signal* signal); | |
| 44 | |
| 45 // Called by dbus:: when the orientation change signal is initially connected. | |
| 46 void OrientationChangedConnected(const std::string& interface_name, | |
| 47 const std::string& signal_name, | |
| 48 bool success); | |
| 49 | |
| 50 scoped_refptr<dbus::Bus> bus_; | |
| 51 dbus::ObjectProxy* sensors_proxy_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(SensorsSourceChromeos); | |
| 54 }; | |
| 55 | |
| 56 } // namespace sensors | |
| 57 | |
| 58 #endif // CONTENT_BROWSER_CHROMEOS_SENSORS_SOURCE_CHROMEOS_H_ | |
| OLD | NEW |