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

Unified Diff: content/common/sensors_listener.h

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698