#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_LOCATION_MONITOR_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_LOCATION_MONITOR_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "content/public/browser/geolocation_provider.h"
namespace chromeos {
class LoginLocationMonitor {
public:
~LoginLocationMonitor();
static void InstallLocationCallback(const base::TimeDelta timeout);
static void RemoveLocationCallback();
private:
friend struct DefaultSingletonTraits<LoginLocationMonitor>;
friend class Singleton<chromeos::LoginLocationMonitor>;
LoginLocationMonitor();
static LoginLocationMonitor* GetInstance();
static void DoInstallLocationCallback(
content::GeolocationProvider::LocationUpdateCallback callback);
static void DoRemoveLocationCallback(
content::GeolocationProvider::LocationUpdateCallback callback);
static void OnLocationUpdatedIO(const content::Geoposition& position);
static void OnLocationUpdatedUI(const content::Geoposition& position);
base::WeakPtrFactory<LoginLocationMonitor> weak_factory_;
content::GeolocationProvider::LocationUpdateCallback on_location_update_;
base::OneShotTimer<LoginLocationMonitor> request_timeout_;
base::Time started_;
DISALLOW_COPY_AND_ASSIGN(LoginLocationMonitor);
};
}
#endif