OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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_DEVICE_ORIENTATION_OBSERVER_DELEGATE_H_ | |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_OBSERVER_DELEGATE_H_ | |
7 | |
8 #include "content/browser/device_orientation/device_data.h" | |
9 #include "content/browser/device_orientation/provider.h" | |
10 | |
11 namespace IPC { | |
12 class Sender; | |
13 } | |
14 | |
15 namespace device_orientation { | |
16 | |
17 class ObserverDelegate | |
18 : public base::RefCounted<ObserverDelegate>, public Provider::Observer { | |
19 public: | |
20 // Create ObserverDelegate that observes provider and forwards updates to | |
21 // render_view_id in process_id. | |
hans
2012/07/30 16:12:52
the "in process_id" part of the comment doesn't se
aousterh
2012/08/03 11:08:14
Done.
| |
22 // Will stop observing provider when destructed. | |
23 ObserverDelegate(DeviceData::Type device_data_type, Provider* provider, | |
24 int render_view_id, IPC::Sender* sender); | |
25 | |
26 // From Provider::Observer. | |
27 virtual void OnDeviceDataUpdate(const DeviceData* device_data, | |
28 DeviceData::Type device_data_type) OVERRIDE; | |
29 | |
30 private: | |
31 static DeviceData* EmptyDeviceData(DeviceData::Type type); | |
32 | |
33 friend class base::RefCounted<ObserverDelegate>; | |
34 virtual ~ObserverDelegate(); | |
35 | |
36 scoped_refptr<Provider> provider_; | |
37 int render_view_id_; | |
38 IPC::Sender* sender_; // Weak pointer. | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(ObserverDelegate); | |
41 }; | |
42 | |
43 } // namespace device_orientation | |
44 | |
45 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_OBSERVER_DELEGATE_H_ | |
OLD | NEW |