2015-01-23 12:43:46 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_WindowsLocationProvider_h__
|
|
|
|
#define mozilla_dom_WindowsLocationProvider_h__
|
|
|
|
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIGeolocationProvider.h"
|
|
|
|
|
2015-01-29 15:02:07 +03:00
|
|
|
#include <locationapi.h>
|
2015-01-23 12:43:46 +03:00
|
|
|
|
2015-03-10 19:47:40 +03:00
|
|
|
class MLSFallback;
|
|
|
|
|
2015-01-23 12:43:46 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class WindowsLocationProvider final : public nsIGeolocationProvider
|
2015-01-23 12:43:46 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIGEOLOCATIONPROVIDER
|
|
|
|
|
|
|
|
WindowsLocationProvider();
|
|
|
|
|
2015-03-10 19:47:40 +03:00
|
|
|
nsresult CreateAndWatchMLSProvider(nsIGeolocationUpdate* aCallback);
|
|
|
|
void CancelMLSProvider();
|
|
|
|
|
|
|
|
class MLSUpdate : public nsIGeolocationUpdate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIGEOLOCATIONUPDATE
|
|
|
|
explicit MLSUpdate(nsIGeolocationUpdate* aCallback);
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIGeolocationUpdate> mCallback;
|
|
|
|
virtual ~MLSUpdate() {}
|
|
|
|
};
|
2015-01-23 12:43:46 +03:00
|
|
|
private:
|
2015-03-10 19:47:40 +03:00
|
|
|
~WindowsLocationProvider();
|
2015-01-29 15:02:07 +03:00
|
|
|
|
2015-01-23 12:43:46 +03:00
|
|
|
nsRefPtr<ILocation> mLocation;
|
2015-03-10 19:47:40 +03:00
|
|
|
nsRefPtr<MLSFallback> mMLSProvider;
|
2015-01-23 12:43:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_WindowsLocationProvider_h__
|