OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_SENSORS_PROVIDER_IMPL_H_ | |
tfarina
2011/07/25 14:57:52
CONTENT_BROWSER_SENSORS_SENSORS_PROVIDER_IMPL_H_
| |
6 #define CONTENT_BROWSER_SENSORS_PROVIDER_IMPL_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/observer_list_threadsafe.h" | |
11 #include "content/browser/sensors/sensors_provider.h" | |
12 | |
13 template <typename T> struct DefaultSingletonTraits; | |
14 | |
15 namespace sensors { | |
16 | |
17 class ProviderImpl : public Provider { | |
18 public: | |
19 static ProviderImpl* GetInstance(); | |
20 | |
21 // Provider implementation | |
22 virtual void AddListener(Listener* listener) OVERRIDE; | |
tfarina
2011/07/25 14:57:52
It's more common to have this named:
AddObserver(
cwolfe
2011/07/25 15:49:45
Differences coming in later revisions. Most notabl
| |
23 virtual void RemoveListener(Listener* listener) OVERRIDE; | |
24 virtual void ScreenOrientationChanged(const ScreenOrientation& change) | |
tfarina
2011/07/25 14:57:52
move this to the line below so you don't leave OVE
| |
25 OVERRIDE; | |
26 | |
27 private: | |
28 friend struct DefaultSingletonTraits<ProviderImpl>; | |
29 | |
30 ProviderImpl(); | |
31 virtual ~ProviderImpl(); | |
32 | |
33 typedef ObserverListThreadSafe<Listener> ListenerList; | |
34 scoped_refptr<ListenerList> listeners_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(ProviderImpl); | |
37 }; | |
38 | |
39 } // namespace sensors | |
40 | |
41 DISABLE_RUNNABLE_METHOD_REFCOUNT(sensors::ProviderImpl); | |
tfarina
2011/07/25 14:57:52
Add a comment explaining why you need this?
| |
42 | |
43 #endif // CONTENT_BROWSER_SENSORS_PROVIDER_IMPL_H_ | |
OLD | NEW |