#ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_
#define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_OBSERVER_H_
#include "base/basictypes.h"
#include "content/common/content_export.h"
namespace content {
struct Geoposition;
}
class CONTENT_EXPORT GeolocationObserver {
public:
virtual void OnLocationUpdate(const content::Geoposition& position) = 0;
protected:
GeolocationObserver() {}
virtual ~GeolocationObserver() {}
private:
DISALLOW_COPY_AND_ASSIGN(GeolocationObserver);
};
struct GeolocationObserverOptions {
GeolocationObserverOptions() : use_high_accuracy(false) {}
explicit GeolocationObserverOptions(bool high_accuracy)
: use_high_accuracy(high_accuracy) {}
template <typename MAP>
static GeolocationObserverOptions Collapse(const MAP& options_map) {
for (typename MAP::const_iterator it = options_map.begin();
it != options_map.end(); ++it) {
if (it->second.use_high_accuracy)
return GeolocationObserverOptions(true);
}
return GeolocationObserverOptions(false);
}
void Collapse(const GeolocationObserverOptions& other) {
use_high_accuracy = use_high_accuracy | other.use_high_accuracy;
}
bool use_high_accuracy;
};
#endif