Chromium Code Reviews| 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 device_orientation { | |
| 12 | |
| 13 class ObserverDelegate | |
| 14 : public base::RefCounted<ObserverDelegate>, public Provider::Observer { | |
| 15 public: | |
| 16 // Create ObserverDelegate that observes provider and forwards updates to | |
|
hans
2012/07/18 17:21:02
this and the lines below are indented too much
aousterh
2012/07/20 11:18:52
Done.
| |
| 17 // render_view_id in process_id. | |
| 18 // Will stop observing provider when destructed. | |
| 19 ObserverDelegate(DeviceData::Type device_data_type, Provider* provider, | |
| 20 int render_view_id, IPC::Sender* sender); | |
| 21 | |
| 22 // From Provider::Observer. | |
| 23 virtual void OnDeviceDataUpdate(const DeviceData* device_data, | |
| 24 DeviceData::Type device_data_type) OVERRIDE; | |
| 25 | |
| 26 private: | |
| 27 static DeviceData* EmptyDeviceData(DeviceData::Type type); | |
| 28 | |
| 29 friend class base::RefCounted<ObserverDelegate>; | |
| 30 virtual ~ObserverDelegate(); | |
| 31 | |
| 32 scoped_refptr<Provider> provider_; | |
| 33 int render_view_id_; | |
| 34 IPC::Sender* sender_; // Weak pointer. | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(ObserverDelegate); | |
| 37 }; | |
| 38 | |
| 39 } // namespace device_orientation | |
| 40 | |
| 41 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_OBSERVER_DELEGATE_H_ | |
| OLD | NEW |