OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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_DEVICE_ORIENTATION_DISPATCHER_HOST_H_ |
| 6 #define CHROME_BROWSER_DEVICE_ORIENTATION_DISPATCHER_HOST_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "base/ref_counted.h" |
| 11 #include "chrome/browser/device_orientation/provider.h" |
| 12 |
| 13 namespace IPC { class Message; } |
| 14 |
| 15 namespace device_orientation { |
| 16 |
| 17 class Orientation; |
| 18 |
| 19 class DispatcherHost : public base::RefCountedThreadSafe<DispatcherHost>, |
| 20 public Provider::Observer { |
| 21 public: |
| 22 explicit DispatcherHost(int process_id); |
| 23 bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok); |
| 24 |
| 25 // From Provider::Observer. |
| 26 virtual void OnOrientationUpdate(const Orientation& orientation); |
| 27 |
| 28 private: |
| 29 virtual ~DispatcherHost(); |
| 30 friend class base::RefCountedThreadSafe<DispatcherHost>; |
| 31 |
| 32 void OnStartUpdating(int render_view_id); |
| 33 void OnStopUpdating(int render_view_id); |
| 34 |
| 35 int process_id_; |
| 36 std::set<int> render_view_ids_; |
| 37 scoped_refptr<Provider> provider_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(DispatcherHost); |
| 40 }; |
| 41 |
| 42 } // namespace device_orientation |
| 43 |
| 44 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DISPATCHER_HOST_H_ |
OLD | NEW |