OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ | 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/browser/device_orientation/device_data.h" | 9 #include "content/browser/device_orientation/device_data.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace device_orientation { | 12 namespace content { |
13 | 13 |
14 class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> { | 14 class CONTENT_EXPORT Provider : public base::RefCountedThreadSafe<Provider> { |
15 public: | 15 public: |
16 class Observer { | 16 class Observer { |
17 public: | 17 public: |
18 // Called when device data changes. | 18 // Called when device data changes. |
19 // An Observer must not synchronously call Provider::RemoveObserver | 19 // An Observer must not synchronously call Provider::RemoveObserver |
20 // or Provider::AddObserver when this is called. | 20 // or Provider::AddObserver when this is called. |
21 virtual void OnDeviceDataUpdate(const DeviceData* device_data, | 21 virtual void OnDeviceDataUpdate(const DeviceData* device_data, |
22 DeviceData::Type device_data_type) = 0; | 22 DeviceData::Type device_data_type) = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 Provider(); | 55 Provider(); |
56 virtual ~Provider(); | 56 virtual ~Provider(); |
57 | 57 |
58 private: | 58 private: |
59 friend class base::RefCountedThreadSafe<Provider>; | 59 friend class base::RefCountedThreadSafe<Provider>; |
60 static Provider* instance_; | 60 static Provider* instance_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(Provider); | 62 DISALLOW_COPY_AND_ASSIGN(Provider); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace device_orientation | 65 } // namespace content |
66 | 66 |
67 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ | 67 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_H_ |
OLD | NEW |