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

Unified Diff: chrome/browser/device_orientation/dispatcher_host.h

Issue 2858049: Chromium plumbing for Device Orientation. (Closed)
Patch Set: Fixes after try bot runs Created 10 years, 4 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: chrome/browser/device_orientation/dispatcher_host.h
diff --git a/chrome/browser/device_orientation/dispatcher_host.h b/chrome/browser/device_orientation/dispatcher_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..f43a68bcd5dae84cb996f563b8d0f007bc4cb705
--- /dev/null
+++ b/chrome/browser/device_orientation/dispatcher_host.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2010 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 CHROME_BROWSER_DEVICE_ORIENTATION_DISPATCHER_HOST_H_
+#define CHROME_BROWSER_DEVICE_ORIENTATION_DISPATCHER_HOST_H_
+
+#include <set>
+
+#include "base/ref_counted.h"
+#include "chrome/browser/device_orientation/provider.h"
+
+namespace IPC { class Message; }
+
+namespace device_orientation {
+
+class Orientation;
+
+class DispatcherHost : public base::RefCountedThreadSafe<DispatcherHost>,
+ public Provider::Observer {
+ public:
+ explicit DispatcherHost(int process_id);
+ bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok);
+
+ // From Provider::Observer.
+ virtual void OnOrientationUpdate(const Orientation& orientation);
+
+ private:
+ virtual ~DispatcherHost();
+ friend class base::RefCountedThreadSafe<DispatcherHost>;
+
+ void OnStartUpdating(int render_view_id);
+ void OnStopUpdating(int render_view_id);
+
+ int process_id_;
+ std::set<int> render_view_ids_;
+ scoped_refptr<Provider> provider_;
+
+ DISALLOW_COPY_AND_ASSIGN(DispatcherHost);
+};
+
+} // namespace device_orientation
+
+#endif // CHROME_BROWSER_DEVICE_ORIENTATION_DISPATCHER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698