Index: content/common/sensors_listener.h |
diff --git a/content/common/sensors_listener.h b/content/common/sensors_listener.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c13ca6cc3638506d0fe52164880cce21c6aab9cb |
--- /dev/null |
+++ b/content/common/sensors_listener.h |
@@ -0,0 +1,49 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_SENSORS_LISTENER_H_ |
+#define CONTENT_COMMON_SENSORS_LISTENER_H_ |
+#pragma once |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+#include "content/common/sensors.h" |
+ |
+#include <string> |
+ |
+namespace sensors { |
+ |
+class Listener { |
+ public: |
+ virtual void SensorChanged(Channel channel, const std::string& data) = 0; |
+ |
+ // TODO(cwolfe): Provide remaining events |
+ // virtual void SensorUpdated(Channel channel, const std::string& data) = 0; |
+ // virtual void SensorPaused(Channel channel) = 0; |
+ // virtual void SensorStopped(Channel channel) = 0; |
+ |
+ protected: |
+ Listener() {} |
+ virtual ~Listener() {} |
+ |
+ DISALLOW_COPY_AND_ASSIGN(Listener); |
+}; |
+ |
+class Connection : public base::RefCountedThreadSafe<Connection> { |
+ public: |
+ virtual void Start(Channel channel, const std::string& data) = 0; |
+ virtual void Stop(Channel channel) = 0; |
+ virtual void Close() = 0; |
+ |
+ protected: |
+ Connection() {}; |
+ virtual ~Connection() {}; |
+ friend class base::RefCountedThreadSafe<Connection>; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(Connection); |
+}; |
+ |
+} // namespace sensors |
+ |
+#endif // CONTENT_COMMON_SENSORS_LISTENER_H_ |