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