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

Side by Side Diff: content/browser/device_orientation/observer_delegate.h

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Handles null device_data in observer Created 8 years, 5 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698