| 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 CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/geolocation/device_data_provider.h" | 8 #include "chrome/browser/geolocation/device_data_provider.h" |
| 9 | 9 |
| 10 // An implementation of DeviceDataProviderImplBase that does not provide any | 10 // An implementation of DeviceDataProviderImplBase that does not provide any |
| 11 // 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. |
| 12 | 12 |
| 13 template<typename DataType> | 13 template<typename DataType> |
| 14 class EmptyDeviceDataProvider : public DeviceDataProviderImplBase<DataType> { | 14 class EmptyDeviceDataProvider : public DeviceDataProviderImplBase<DataType> { |
| 15 public: | 15 public: |
| 16 EmptyDeviceDataProvider() {} | 16 EmptyDeviceDataProvider() {} |
| 17 virtual ~EmptyDeviceDataProvider() {} | 17 virtual ~EmptyDeviceDataProvider() {} |
| 18 | 18 |
| 19 // DeviceDataProviderImplBase implementation | 19 // DeviceDataProviderImplBase implementation |
| 20 virtual bool StartDataProvider() { return true; } | 20 virtual bool StartDataProvider() { return true; } |
| 21 virtual bool GetData(DataType *data) { | 21 virtual bool GetData(DataType *data) { |
| 22 DCHECK(data); | 22 assert(data); |
| 23 // This is all the data we can get - nothing. | 23 // This is all the data we can get - nothing. |
| 24 return true; | 24 return true; |
| 25 } | 25 } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(EmptyDeviceDataProvider); | 28 DISALLOW_COPY_AND_ASSIGN(EmptyDeviceDataProvider); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 #endif // CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ | 31 #endif // CHROME_BROWSER_GEOLOCATION_EMPTY_DEVICE_DATA_PROVIDER_H_ |
| OLD | NEW |