2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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/. */
|
2011-11-02 17:44:16 +04:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_Navigator_h
|
|
|
|
#define mozilla_dom_Navigator_h
|
|
|
|
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2014-03-06 19:51:23 +04:00
|
|
|
#include "mozilla/dom/Nullable.h"
|
2013-08-15 22:17:48 +04:00
|
|
|
#include "mozilla/ErrorResult.h"
|
2011-11-02 17:44:16 +04:00
|
|
|
#include "nsIDOMNavigator.h"
|
2013-07-18 07:23:52 +04:00
|
|
|
#include "nsIMozNavigatorNetwork.h"
|
2011-11-02 17:44:16 +04:00
|
|
|
#include "nsAutoPtr.h"
|
2013-06-20 22:34:38 +04:00
|
|
|
#include "nsWrapperCache.h"
|
2014-03-21 07:19:43 +04:00
|
|
|
#include "nsHashKeys.h"
|
|
|
|
#include "nsInterfaceHashtable.h"
|
2013-08-15 22:17:48 +04:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsTArray.h"
|
2014-11-18 12:13:02 +03:00
|
|
|
#ifdef MOZ_EME
|
2015-03-31 10:50:01 +03:00
|
|
|
#include "mozilla/dom/MediaKeySystemAccessManager.h"
|
2014-11-18 12:13:02 +03:00
|
|
|
#endif
|
2011-11-02 17:44:16 +04:00
|
|
|
|
|
|
|
class nsPluginArray;
|
|
|
|
class nsMimeTypeArray;
|
2011-12-01 12:28:16 +04:00
|
|
|
class nsPIDOMWindow;
|
2013-08-15 22:17:48 +04:00
|
|
|
class nsIDOMNavigatorSystemMessages;
|
|
|
|
class nsDOMCameraManager;
|
|
|
|
class nsDOMDeviceStorage;
|
2014-03-12 13:03:05 +04:00
|
|
|
class nsIPrincipal;
|
2014-09-24 20:09:50 +04:00
|
|
|
class nsIURI;
|
2011-11-02 17:44:16 +04:00
|
|
|
|
2013-04-12 22:46:36 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2013-04-12 22:47:47 +04:00
|
|
|
class Geolocation;
|
2013-07-12 18:35:44 +04:00
|
|
|
class systemMessageCallback;
|
2014-09-20 10:20:41 +04:00
|
|
|
class MediaDevices;
|
2014-06-19 04:57:51 +04:00
|
|
|
struct MediaStreamConstraints;
|
2014-01-07 16:16:07 +04:00
|
|
|
class WakeLock;
|
2014-03-06 19:51:23 +04:00
|
|
|
class ArrayBufferViewOrBlobOrStringOrFormData;
|
2014-06-27 03:18:21 +04:00
|
|
|
struct MobileIdOptions;
|
2014-08-19 17:56:00 +04:00
|
|
|
class ServiceWorkerContainer;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-04-12 22:46:36 +04:00
|
|
|
|
2011-11-02 17:44:16 +04:00
|
|
|
//*****************************************************************************
|
|
|
|
// Navigator: Script "navigator" object
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-07-28 16:33:46 +03:00
|
|
|
class Permissions;
|
|
|
|
|
2011-11-02 19:27:06 +04:00
|
|
|
namespace battery {
|
|
|
|
class BatteryManager;
|
|
|
|
} // namespace battery
|
|
|
|
|
2013-09-04 02:26:33 +04:00
|
|
|
#ifdef MOZ_B2G_FM
|
|
|
|
class FMRadio;
|
|
|
|
#endif
|
|
|
|
|
2013-10-02 21:27:07 +04:00
|
|
|
class Promise;
|
|
|
|
|
2013-04-10 18:20:43 +04:00
|
|
|
class DesktopNotificationCenter;
|
2013-03-09 11:21:47 +04:00
|
|
|
class MobileMessageManager;
|
2013-07-12 18:35:35 +04:00
|
|
|
class MozIdleObserver;
|
2013-07-12 18:36:32 +04:00
|
|
|
#ifdef MOZ_GAMEPAD
|
|
|
|
class Gamepad;
|
|
|
|
#endif // MOZ_GAMEPAD
|
2013-07-12 18:37:21 +04:00
|
|
|
#ifdef MOZ_MEDIA_NAVIGATOR
|
2013-09-16 10:34:57 +04:00
|
|
|
class NavigatorUserMediaSuccessCallback;
|
|
|
|
class NavigatorUserMediaErrorCallback;
|
2013-07-12 18:37:21 +04:00
|
|
|
class MozGetUserMediaDevicesSuccessCallback;
|
|
|
|
#endif // MOZ_MEDIA_NAVIGATOR
|
2011-11-25 04:48:57 +04:00
|
|
|
|
2012-01-16 21:14:56 +04:00
|
|
|
namespace network {
|
|
|
|
class Connection;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace network
|
2012-01-16 21:14:56 +04:00
|
|
|
|
2013-08-12 12:31:58 +04:00
|
|
|
#ifdef MOZ_B2G_BT
|
|
|
|
namespace bluetooth {
|
|
|
|
class BluetoothManager;
|
|
|
|
} // namespace bluetooth
|
|
|
|
#endif // MOZ_B2G_BT
|
|
|
|
|
2013-09-03 18:38:53 +04:00
|
|
|
#ifdef MOZ_B2G_RIL
|
2014-01-02 07:06:17 +04:00
|
|
|
class MobileConnectionArray;
|
2013-09-03 18:38:53 +04:00
|
|
|
#endif
|
|
|
|
|
2012-01-20 07:24:00 +04:00
|
|
|
class PowerManager;
|
2014-08-25 13:24:03 +04:00
|
|
|
class CellBroadcast;
|
2015-01-14 09:43:32 +03:00
|
|
|
class IccManager;
|
2013-10-29 12:12:38 +04:00
|
|
|
class Telephony;
|
2014-09-26 09:00:23 +04:00
|
|
|
class Voicemail;
|
2014-08-21 13:15:18 +04:00
|
|
|
class TVManager;
|
2015-04-08 10:07:00 +03:00
|
|
|
class InputPortManager;
|
2015-05-04 09:11:00 +03:00
|
|
|
class DeviceStorageAreaListener;
|
2012-01-20 07:24:00 +04:00
|
|
|
|
2012-09-11 10:05:00 +04:00
|
|
|
namespace time {
|
|
|
|
class TimeManager;
|
|
|
|
} // namespace time
|
|
|
|
|
2012-11-30 02:52:03 +04:00
|
|
|
namespace system {
|
|
|
|
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
|
|
|
class AudioChannelManager;
|
|
|
|
#endif
|
|
|
|
} // namespace system
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class Navigator final : public nsIDOMNavigator
|
2015-03-27 21:52:19 +03:00
|
|
|
, public nsIMozNavigatorNetwork
|
|
|
|
, public nsWrapperCache
|
2011-11-02 17:44:16 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit Navigator(nsPIDOMWindow* aInnerWindow);
|
2011-11-02 17:44:16 +04:00
|
|
|
|
2013-06-20 22:34:38 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Navigator,
|
|
|
|
nsIDOMNavigator)
|
2011-11-02 17:44:16 +04:00
|
|
|
NS_DECL_NSIDOMNAVIGATOR
|
2013-07-18 07:23:52 +04:00
|
|
|
NS_DECL_NSIMOZNAVIGATORNETWORK
|
2012-02-20 19:15:19 +04:00
|
|
|
|
2011-11-02 17:44:16 +04:00
|
|
|
static void Init();
|
|
|
|
|
2011-12-01 12:28:16 +04:00
|
|
|
void Invalidate();
|
2013-07-12 18:35:35 +04:00
|
|
|
nsPIDOMWindow *GetWindow() const
|
2013-06-20 22:34:38 +04:00
|
|
|
{
|
|
|
|
return mWindow;
|
|
|
|
}
|
2011-11-02 17:44:16 +04:00
|
|
|
|
2011-12-01 12:28:16 +04:00
|
|
|
void RefreshMIMEArray();
|
2011-11-02 17:44:16 +04:00
|
|
|
|
2013-06-23 16:03:39 +04:00
|
|
|
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
2011-11-02 17:44:16 +04:00
|
|
|
|
2011-12-28 17:39:55 +04:00
|
|
|
/**
|
|
|
|
* For use during document.write where our inner window changes.
|
|
|
|
*/
|
|
|
|
void SetWindow(nsPIDOMWindow *aInnerWindow);
|
|
|
|
|
2012-06-03 11:35:15 +04:00
|
|
|
/**
|
|
|
|
* Called when the inner window navigates to a new page.
|
|
|
|
*/
|
|
|
|
void OnNavigation();
|
|
|
|
|
2012-07-03 04:16:55 +04:00
|
|
|
// Helper to initialize mMessagesManager.
|
|
|
|
nsresult EnsureMessagesManager();
|
2013-04-30 17:01:46 +04:00
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
// The XPCOM GetProduct is OK
|
|
|
|
// The XPCOM GetLanguage is OK
|
|
|
|
bool OnLine();
|
|
|
|
void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL,
|
2013-07-18 07:23:52 +04:00
|
|
|
const nsAString& aTitle, ErrorResult& aRv);
|
2013-07-12 18:35:35 +04:00
|
|
|
void RegisterContentHandler(const nsAString& aMIMEType, const nsAString& aURL,
|
2013-07-18 07:23:52 +04:00
|
|
|
const nsAString& aTitle, ErrorResult& aRv);
|
2013-07-12 18:35:35 +04:00
|
|
|
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
|
|
|
|
nsPluginArray* GetPlugins(ErrorResult& aRv);
|
2015-07-28 16:33:46 +03:00
|
|
|
Permissions* GetPermissions(ErrorResult& aRv);
|
2013-07-12 18:35:35 +04:00
|
|
|
// The XPCOM GetDoNotTrack is ok
|
|
|
|
Geolocation* GetGeolocation(ErrorResult& aRv);
|
|
|
|
battery::BatteryManager* GetBattery(ErrorResult& aRv);
|
2014-02-24 17:57:15 +04:00
|
|
|
|
|
|
|
static already_AddRefed<Promise> GetDataStores(nsPIDOMWindow* aWindow,
|
|
|
|
const nsAString& aName,
|
2014-07-17 07:53:23 +04:00
|
|
|
const nsAString& aOwner,
|
2014-02-24 17:57:15 +04:00
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2014-09-23 23:11:18 +04:00
|
|
|
static void AppName(nsAString& aAppName, bool aUsePrefOverriddenValue);
|
|
|
|
|
|
|
|
static nsresult GetPlatform(nsAString& aPlatform,
|
|
|
|
bool aUsePrefOverriddenValue);
|
|
|
|
|
|
|
|
static nsresult GetAppVersion(nsAString& aAppVersion,
|
|
|
|
bool aUsePrefOverriddenValue);
|
|
|
|
|
2014-09-24 20:09:50 +04:00
|
|
|
static nsresult GetUserAgent(nsPIDOMWindow* aWindow,
|
|
|
|
nsIURI* aURI,
|
|
|
|
bool aIsCallerChrome,
|
|
|
|
nsAString& aUserAgent);
|
|
|
|
|
2014-07-17 07:53:23 +04:00
|
|
|
already_AddRefed<Promise> GetDataStores(const nsAString& aName,
|
|
|
|
const nsAString& aOwner,
|
2013-10-02 21:27:07 +04:00
|
|
|
ErrorResult& aRv);
|
2014-05-12 06:05:03 +04:00
|
|
|
|
|
|
|
// Feature Detection API
|
2014-07-17 07:53:23 +04:00
|
|
|
already_AddRefed<Promise> GetFeature(const nsAString& aName,
|
2014-07-19 05:31:11 +04:00
|
|
|
ErrorResult& aRv);
|
2014-05-12 06:05:03 +04:00
|
|
|
|
2014-07-24 23:57:02 +04:00
|
|
|
already_AddRefed<Promise> HasFeature(const nsAString &aName,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2013-09-28 22:58:38 +04:00
|
|
|
bool Vibrate(uint32_t aDuration);
|
|
|
|
bool Vibrate(const nsTArray<uint32_t>& aDuration);
|
2014-01-28 20:09:34 +04:00
|
|
|
uint32_t MaxTouchPoints();
|
2013-07-12 18:35:35 +04:00
|
|
|
void GetAppCodeName(nsString& aAppCodeName, ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = GetAppCodeName(aAppCodeName);
|
|
|
|
}
|
|
|
|
void GetOscpu(nsString& aOscpu, ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = GetOscpu(aOscpu);
|
|
|
|
}
|
|
|
|
// The XPCOM GetVendor is OK
|
|
|
|
// The XPCOM GetVendorSub is OK
|
|
|
|
// The XPCOM GetProductSub is OK
|
|
|
|
bool CookieEnabled();
|
|
|
|
void GetBuildID(nsString& aBuildID, ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = GetBuildID(aBuildID);
|
|
|
|
}
|
2013-09-11 18:35:04 +04:00
|
|
|
PowerManager* GetMozPower(ErrorResult& aRv);
|
2013-07-12 18:35:35 +04:00
|
|
|
bool JavaEnabled(ErrorResult& aRv);
|
|
|
|
bool TaintEnabled()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void AddIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
|
|
|
|
void RemoveIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
|
2014-01-07 16:16:07 +04:00
|
|
|
already_AddRefed<WakeLock> RequestWakeLock(const nsAString &aTopic,
|
|
|
|
ErrorResult& aRv);
|
2015-05-04 09:11:00 +03:00
|
|
|
DeviceStorageAreaListener* GetDeviceStorageAreaListener(ErrorResult& aRv);
|
2013-07-12 18:35:44 +04:00
|
|
|
nsDOMDeviceStorage* GetDeviceStorage(const nsAString& aType,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
void GetDeviceStorages(const nsAString& aType,
|
|
|
|
nsTArray<nsRefPtr<nsDOMDeviceStorage> >& aStores,
|
|
|
|
ErrorResult& aRv);
|
2015-05-04 09:11:00 +03:00
|
|
|
nsDOMDeviceStorage* GetDeviceStorageByNameAndType(const nsAString& aName,
|
|
|
|
const nsAString& aType,
|
|
|
|
ErrorResult& aRv);
|
2013-07-12 18:35:44 +04:00
|
|
|
DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
|
2014-08-25 13:24:03 +04:00
|
|
|
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
|
2015-01-14 09:43:32 +03:00
|
|
|
IccManager* GetMozIccManager(ErrorResult& aRv);
|
2014-06-25 07:57:16 +04:00
|
|
|
MobileMessageManager* GetMozMobileMessage();
|
2013-10-29 12:12:38 +04:00
|
|
|
Telephony* GetMozTelephony(ErrorResult& aRv);
|
2014-09-26 09:00:23 +04:00
|
|
|
Voicemail* GetMozVoicemail(ErrorResult& aRv);
|
2014-08-21 13:15:18 +04:00
|
|
|
TVManager* GetTv();
|
2015-04-08 10:07:00 +03:00
|
|
|
InputPortManager* GetInputPortManager(ErrorResult& aRv);
|
2014-03-05 07:54:55 +04:00
|
|
|
network::Connection* GetConnection(ErrorResult& aRv);
|
2013-07-12 18:35:44 +04:00
|
|
|
nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
|
2014-09-20 10:20:41 +04:00
|
|
|
MediaDevices* GetMediaDevices(ErrorResult& aRv);
|
2013-07-12 18:35:44 +04:00
|
|
|
void MozSetMessageHandler(const nsAString& aType,
|
|
|
|
systemMessageCallback* aCallback,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv);
|
2015-01-13 12:53:22 +03:00
|
|
|
void MozSetMessageHandlerPromise(Promise& aPromise, ErrorResult& aRv);
|
|
|
|
|
2014-06-07 21:30:18 +04:00
|
|
|
#ifdef MOZ_B2G
|
2014-06-27 03:18:21 +04:00
|
|
|
already_AddRefed<Promise> GetMobileIdAssertion(const MobileIdOptions& options,
|
|
|
|
ErrorResult& aRv);
|
2014-06-07 21:30:18 +04:00
|
|
|
#endif
|
2013-07-12 18:36:13 +04:00
|
|
|
#ifdef MOZ_B2G_RIL
|
2014-01-02 07:06:17 +04:00
|
|
|
MobileConnectionArray* GetMozMobileConnections(ErrorResult& aRv);
|
2014-06-27 03:18:21 +04:00
|
|
|
#endif // MOZ_B2G_RIL
|
2013-07-12 18:36:32 +04:00
|
|
|
#ifdef MOZ_GAMEPAD
|
|
|
|
void GetGamepads(nsTArray<nsRefPtr<Gamepad> >& aGamepads, ErrorResult& aRv);
|
|
|
|
#endif // MOZ_GAMEPAD
|
2014-07-09 23:24:49 +04:00
|
|
|
already_AddRefed<Promise> GetVRDevices(ErrorResult& aRv);
|
2013-09-04 02:26:33 +04:00
|
|
|
#ifdef MOZ_B2G_FM
|
|
|
|
FMRadio* GetMozFMRadio(ErrorResult& aRv);
|
|
|
|
#endif
|
2013-07-12 18:36:32 +04:00
|
|
|
#ifdef MOZ_B2G_BT
|
2013-08-12 12:31:58 +04:00
|
|
|
bluetooth::BluetoothManager* GetMozBluetooth(ErrorResult& aRv);
|
2013-07-12 18:36:32 +04:00
|
|
|
#endif // MOZ_B2G_BT
|
|
|
|
#ifdef MOZ_TIME_MANAGER
|
|
|
|
time::TimeManager* GetMozTime(ErrorResult& aRv);
|
|
|
|
#endif // MOZ_TIME_MANAGER
|
|
|
|
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
|
|
|
system::AudioChannelManager* GetMozAudioChannelManager(ErrorResult& aRv);
|
|
|
|
#endif // MOZ_AUDIO_CHANNEL_MANAGER
|
2014-03-06 19:51:23 +04:00
|
|
|
|
|
|
|
bool SendBeacon(const nsAString& aUrl,
|
|
|
|
const Nullable<ArrayBufferViewOrBlobOrStringOrFormData>& aData,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2013-07-12 18:37:21 +04:00
|
|
|
#ifdef MOZ_MEDIA_NAVIGATOR
|
2014-04-18 22:00:16 +04:00
|
|
|
void MozGetUserMedia(const MediaStreamConstraints& aConstraints,
|
2013-09-16 10:34:57 +04:00
|
|
|
NavigatorUserMediaSuccessCallback& aOnSuccess,
|
|
|
|
NavigatorUserMediaErrorCallback& aOnError,
|
2013-07-12 18:37:21 +04:00
|
|
|
ErrorResult& aRv);
|
2014-04-18 22:00:16 +04:00
|
|
|
void MozGetUserMediaDevices(const MediaStreamConstraints& aConstraints,
|
2013-09-16 10:34:57 +04:00
|
|
|
MozGetUserMediaDevicesSuccessCallback& aOnSuccess,
|
|
|
|
NavigatorUserMediaErrorCallback& aOnError,
|
2014-02-14 23:32:58 +04:00
|
|
|
uint64_t aInnerWindowID,
|
2013-07-12 18:37:21 +04:00
|
|
|
ErrorResult& aRv);
|
|
|
|
#endif // MOZ_MEDIA_NAVIGATOR
|
2013-11-20 03:14:07 +04:00
|
|
|
|
2014-08-19 17:56:00 +04:00
|
|
|
already_AddRefed<ServiceWorkerContainer> ServiceWorker();
|
2013-11-20 03:14:07 +04:00
|
|
|
|
2014-11-08 03:07:12 +03:00
|
|
|
bool DoResolve(JSContext* aCx, JS::Handle<JSObject*> aObject,
|
|
|
|
JS::Handle<jsid> aId,
|
|
|
|
JS::MutableHandle<JSPropertyDescriptor> aDesc);
|
2015-04-28 19:25:55 +03:00
|
|
|
// The return value is whether DoResolve might end up resolving the given id.
|
|
|
|
// If in doubt, return true.
|
|
|
|
static bool MayResolve(jsid aId);
|
2013-08-04 07:38:54 +04:00
|
|
|
void GetOwnPropertyNames(JSContext* aCx, nsTArray<nsString>& aNames,
|
|
|
|
ErrorResult& aRv);
|
2014-05-12 15:48:15 +04:00
|
|
|
void GetLanguages(nsTArray<nsString>& aLanguages);
|
2014-09-05 18:26:34 +04:00
|
|
|
|
2015-02-18 01:10:45 +03:00
|
|
|
bool MozE10sEnabled();
|
|
|
|
|
2014-09-05 18:26:34 +04:00
|
|
|
static void GetAcceptLanguages(nsTArray<nsString>& aLanguages);
|
2013-07-12 18:35:35 +04:00
|
|
|
|
|
|
|
// WebIDL helper methods
|
|
|
|
static bool HasWakeLockSupport(JSContext* /* unused*/, JSObject* /*unused */);
|
2013-07-12 18:35:44 +04:00
|
|
|
static bool HasCameraSupport(JSContext* /* unused */,
|
|
|
|
JSObject* aGlobal);
|
2014-02-05 13:52:25 +04:00
|
|
|
static bool HasWifiManagerSupport(JSContext* /* unused */,
|
|
|
|
JSObject* aGlobal);
|
2013-10-03 02:09:08 +04:00
|
|
|
#ifdef MOZ_NFC
|
2014-04-29 07:50:25 +04:00
|
|
|
static bool HasNFCSupport(JSContext* /* unused */, JSObject* aGlobal);
|
2013-10-03 02:09:08 +04:00
|
|
|
#endif // MOZ_NFC
|
2013-07-12 18:37:21 +04:00
|
|
|
#ifdef MOZ_MEDIA_NAVIGATOR
|
|
|
|
static bool HasUserMediaSupport(JSContext* /* unused */,
|
|
|
|
JSObject* /* unused */);
|
|
|
|
#endif // MOZ_MEDIA_NAVIGATOR
|
2013-07-12 18:36:32 +04:00
|
|
|
|
2013-09-26 11:10:56 +04:00
|
|
|
static bool HasInputMethodSupport(JSContext* /* unused */, JSObject* aGlobal);
|
|
|
|
|
2014-03-12 13:03:05 +04:00
|
|
|
static bool HasDataStoreSupport(nsIPrincipal* aPrincipal);
|
|
|
|
|
2013-12-12 00:15:16 +04:00
|
|
|
static bool HasDataStoreSupport(JSContext* cx, JSObject* aGlobal);
|
2013-12-06 03:12:23 +04:00
|
|
|
|
2014-06-27 03:18:19 +04:00
|
|
|
#ifdef MOZ_B2G
|
|
|
|
static bool HasMobileIdSupport(JSContext* aCx, JSObject* aGlobal);
|
|
|
|
#endif
|
|
|
|
|
2014-08-21 13:15:18 +04:00
|
|
|
static bool HasTVSupport(JSContext* aCx, JSObject* aGlobal);
|
|
|
|
|
2015-02-18 01:10:45 +03:00
|
|
|
static bool IsE10sEnabled(JSContext* aCx, JSObject* aGlobal);
|
|
|
|
|
2013-07-12 18:35:35 +04:00
|
|
|
nsPIDOMWindow* GetParentObject() const
|
|
|
|
{
|
|
|
|
return GetWindow();
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-07-12 18:37:23 +04:00
|
|
|
|
2015-01-15 19:58:41 +03:00
|
|
|
// GetWindowFromGlobal returns the inner window for this global, if
|
|
|
|
// any, else null.
|
|
|
|
static already_AddRefed<nsPIDOMWindow> GetWindowFromGlobal(JSObject* aGlobal);
|
|
|
|
|
2014-11-18 12:13:02 +03:00
|
|
|
#ifdef MOZ_EME
|
|
|
|
already_AddRefed<Promise>
|
|
|
|
RequestMediaKeySystemAccess(const nsAString& aKeySystem,
|
|
|
|
const Optional<Sequence<MediaKeySystemOptions>>& aOptions,
|
|
|
|
ErrorResult& aRv);
|
2015-03-31 10:50:01 +03:00
|
|
|
private:
|
|
|
|
nsRefPtr<MediaKeySystemAccessManager> mMediaKeySystemAccessManager;
|
2014-11-18 12:13:02 +03:00
|
|
|
#endif
|
|
|
|
|
2011-11-02 17:44:16 +04:00
|
|
|
private:
|
2014-06-23 23:56:07 +04:00
|
|
|
virtual ~Navigator();
|
|
|
|
|
2012-10-02 13:08:02 +04:00
|
|
|
bool CheckPermission(const char* type);
|
2013-07-12 18:35:35 +04:00
|
|
|
static bool CheckPermission(nsPIDOMWindow* aWindow, const char* aType);
|
|
|
|
|
2011-11-02 17:44:16 +04:00
|
|
|
nsRefPtr<nsMimeTypeArray> mMimeTypes;
|
|
|
|
nsRefPtr<nsPluginArray> mPlugins;
|
2015-07-28 16:33:46 +03:00
|
|
|
nsRefPtr<Permissions> mPermissions;
|
2013-04-12 22:47:47 +04:00
|
|
|
nsRefPtr<Geolocation> mGeolocation;
|
2013-04-10 18:20:43 +04:00
|
|
|
nsRefPtr<DesktopNotificationCenter> mNotification;
|
2011-11-02 19:27:06 +04:00
|
|
|
nsRefPtr<battery::BatteryManager> mBatteryManager;
|
2013-09-04 02:26:33 +04:00
|
|
|
#ifdef MOZ_B2G_FM
|
|
|
|
nsRefPtr<FMRadio> mFMRadio;
|
|
|
|
#endif
|
2013-09-11 18:35:04 +04:00
|
|
|
nsRefPtr<PowerManager> mPowerManager;
|
2014-08-25 13:24:03 +04:00
|
|
|
nsRefPtr<CellBroadcast> mCellBroadcast;
|
2015-01-14 09:43:32 +03:00
|
|
|
nsRefPtr<IccManager> mIccManager;
|
2013-03-09 11:21:47 +04:00
|
|
|
nsRefPtr<MobileMessageManager> mMobileMessageManager;
|
2013-10-29 12:12:38 +04:00
|
|
|
nsRefPtr<Telephony> mTelephony;
|
2014-09-26 09:00:23 +04:00
|
|
|
nsRefPtr<Voicemail> mVoicemail;
|
2014-08-21 13:15:18 +04:00
|
|
|
nsRefPtr<TVManager> mTVManager;
|
2015-04-08 10:07:00 +03:00
|
|
|
nsRefPtr<InputPortManager> mInputPortManager;
|
2012-01-16 21:14:56 +04:00
|
|
|
nsRefPtr<network::Connection> mConnection;
|
2012-08-27 21:34:10 +04:00
|
|
|
#ifdef MOZ_B2G_RIL
|
2014-01-02 07:06:17 +04:00
|
|
|
nsRefPtr<MobileConnectionArray> mMobileConnections;
|
2012-08-27 21:34:10 +04:00
|
|
|
#endif
|
2012-02-20 19:15:19 +04:00
|
|
|
#ifdef MOZ_B2G_BT
|
2014-03-18 04:23:03 +04:00
|
|
|
nsRefPtr<bluetooth::BluetoothManager> mBluetooth;
|
2012-11-30 02:52:03 +04:00
|
|
|
#endif
|
|
|
|
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
|
|
|
nsRefPtr<system::AudioChannelManager> mAudioChannelManager;
|
2012-02-20 19:15:19 +04:00
|
|
|
#endif
|
2012-07-31 01:59:05 +04:00
|
|
|
nsRefPtr<nsDOMCameraManager> mCameraManager;
|
2014-09-20 10:20:41 +04:00
|
|
|
nsRefPtr<MediaDevices> mMediaDevices;
|
2012-07-03 04:16:55 +04:00
|
|
|
nsCOMPtr<nsIDOMNavigatorSystemMessages> mMessagesManager;
|
2012-08-02 10:29:34 +04:00
|
|
|
nsTArray<nsRefPtr<nsDOMDeviceStorage> > mDeviceStorageStores;
|
2012-09-11 10:05:00 +04:00
|
|
|
nsRefPtr<time::TimeManager> mTimeManager;
|
2014-08-19 17:56:00 +04:00
|
|
|
nsRefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
|
2013-06-20 22:34:38 +04:00
|
|
|
nsCOMPtr<nsPIDOMWindow> mWindow;
|
2015-05-04 09:11:00 +03:00
|
|
|
nsRefPtr<DeviceStorageAreaListener> mDeviceStorageAreaListener;
|
2014-03-21 07:19:43 +04:00
|
|
|
|
2014-11-08 03:07:12 +03:00
|
|
|
// Hashtable for saving cached objects DoResolve created, so we don't create
|
2014-03-21 07:19:43 +04:00
|
|
|
// the object twice if asked for it twice, whether due to use of "delete" or
|
|
|
|
// due to Xrays. We could probably use a nsJSThingHashtable here, but then
|
|
|
|
// we'd need to figure out exactly how to trace that, and that seems to be
|
|
|
|
// rocket science. :(
|
|
|
|
nsInterfaceHashtable<nsStringHashKey, nsISupports> mCachedResolveResults;
|
2011-11-02 17:44:16 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_Navigator_h
|