OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
7 #pragma once | |
8 | 7 |
9 #include "content/browser/geolocation/device_data_provider.h" | 8 #include "content/browser/geolocation/device_data_provider.h" |
10 | 9 |
11 // An implementation of DeviceDataProviderImplBase that does not provide any | 10 // An implementation of DeviceDataProviderImplBase that does not provide any |
12 // data. Used on platforms where a given data type is not available. | 11 // data. Used on platforms where a given data type is not available. |
13 | 12 |
14 template<typename DataType> | 13 template<typename DataType> |
15 class EmptyDeviceDataProvider : public DeviceDataProviderImplBase<DataType> { | 14 class EmptyDeviceDataProvider : public DeviceDataProviderImplBase<DataType> { |
16 public: | 15 public: |
17 EmptyDeviceDataProvider() {} | 16 EmptyDeviceDataProvider() {} |
18 virtual ~EmptyDeviceDataProvider() {} | 17 virtual ~EmptyDeviceDataProvider() {} |
19 | 18 |
20 // DeviceDataProviderImplBase implementation | 19 // DeviceDataProviderImplBase implementation |
21 virtual bool StartDataProvider() { return true; } | 20 virtual bool StartDataProvider() { return true; } |
22 virtual void StopDataProvider() { } | 21 virtual void StopDataProvider() { } |
23 virtual bool GetData(DataType *data) { | 22 virtual bool GetData(DataType *data) { |
24 DCHECK(data); | 23 DCHECK(data); |
25 // This is all the data we can get - nothing. | 24 // This is all the data we can get - nothing. |
26 return true; | 25 return true; |
27 } | 26 } |
28 | 27 |
29 private: | 28 private: |
30 DISALLOW_COPY_AND_ASSIGN(EmptyDeviceDataProvider); | 29 DISALLOW_COPY_AND_ASSIGN(EmptyDeviceDataProvider); |
31 }; | 30 }; |
32 | 31 |
33 #endif // CONTENT_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 32 #endif // CONTENT_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
OLD | NEW |