mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 798033 - Headers should generally not do "using namespace" at file scope. r=jib, r=jmathies, r=rjesup, r=ekr, r=ncameron, r=blassey
This commit is contained in:
parent
7c4c979e43
commit
11404d6af2
@ -1882,7 +1882,7 @@ ContentParent::RecvGetShowPasswordSetting(bool* showPassword)
|
|||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
|
NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available");
|
||||||
|
|
||||||
*showPassword = GeckoAppShell::GetShowPasswordSetting();
|
*showPassword = mozilla::widget::android::GeckoAppShell::GetShowPasswordSetting();
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ jclass anp_system_loadJavaClass(NPP instance, const char* classNameStr)
|
|||||||
lib->GetLibraryPath(libNameUtf8);
|
lib->GetLibraryPath(libNameUtf8);
|
||||||
NS_ConvertUTF8toUTF16 libName(libNameUtf8);
|
NS_ConvertUTF8toUTF16 libName(libNameUtf8);
|
||||||
|
|
||||||
return GeckoAppShell::LoadPluginClass(className, libName);
|
return mozilla::widget::android::GeckoAppShell::LoadPluginClass(className, libName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
||||||
|
@ -2253,7 +2253,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case kJavaContext_ANPGetValue: {
|
case kJavaContext_ANPGetValue: {
|
||||||
jobject ret = GeckoAppShell::GetContext();
|
jobject ret = mozilla::widget::android::GeckoAppShell::GetContext();
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
|
|
||||||
|
@ -870,7 +870,7 @@ void nsNPAPIPluginInstance::NotifyFullScreen(bool aFullScreen)
|
|||||||
SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction);
|
SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction);
|
||||||
|
|
||||||
if (mFullScreen && mFullScreenOrientation != dom::eScreenOrientation_None) {
|
if (mFullScreen && mFullScreenOrientation != dom::eScreenOrientation_None) {
|
||||||
GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
mozilla::widget::android::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,11 +927,11 @@ void nsNPAPIPluginInstance::SetFullScreenOrientation(uint32_t orientation)
|
|||||||
// We're already fullscreen so immediately apply the orientation change
|
// We're already fullscreen so immediately apply the orientation change
|
||||||
|
|
||||||
if (mFullScreenOrientation != dom::eScreenOrientation_None) {
|
if (mFullScreenOrientation != dom::eScreenOrientation_None) {
|
||||||
GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
mozilla::widget::android::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
||||||
} else if (oldOrientation != dom::eScreenOrientation_None) {
|
} else if (oldOrientation != dom::eScreenOrientation_None) {
|
||||||
// We applied an orientation when we entered fullscreen, but
|
// We applied an orientation when we entered fullscreen, but
|
||||||
// we don't want it anymore
|
// we don't want it anymore
|
||||||
GeckoAppShell::UnlockScreenOrientation();
|
mozilla::widget::android::GeckoAppShell::UnlockScreenOrientation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1465,7 +1465,7 @@ void nsPluginInstanceOwner::RemovePluginView()
|
|||||||
if (!mInstance || !mJavaView)
|
if (!mInstance || !mJavaView)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::RemovePluginView((jobject)mJavaView, mFullScreen);
|
mozilla::widget::android::GeckoAppShell::RemovePluginView((jobject)mJavaView, mFullScreen);
|
||||||
AndroidBridge::GetJNIEnv()->DeleteGlobalRef((jobject)mJavaView);
|
AndroidBridge::GetJNIEnv()->DeleteGlobalRef((jobject)mJavaView);
|
||||||
mJavaView = nullptr;
|
mJavaView = nullptr;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ AndroidLocationProvider::~AndroidLocationProvider()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::Startup()
|
AndroidLocationProvider::Startup()
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableLocation(true);
|
mozilla::widget::android::GeckoAppShell::EnableLocation(true);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,13 +42,13 @@ AndroidLocationProvider::Watch(nsIGeolocationUpdate* aCallback)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::Shutdown()
|
AndroidLocationProvider::Shutdown()
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableLocation(false);
|
mozilla::widget::android::GeckoAppShell::EnableLocation(false);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::SetHighAccuracy(bool enable)
|
AndroidLocationProvider::SetHighAccuracy(bool enable)
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableLocationHighAccuracy(enable);
|
mozilla::widget::android::GeckoAppShell::EnableLocationHighAccuracy(enable);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ NS_IMPL_ISUPPORTS1(nsHapticFeedback, nsIHapticFeedback)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHapticFeedback::PerformSimpleAction(int32_t aType)
|
nsHapticFeedback::PerformSimpleAction(int32_t aType)
|
||||||
{
|
{
|
||||||
GeckoAppShell::PerformHapticFeedback(aType == LongPress);
|
mozilla::widget::android::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
#include "ImageContainer.h"
|
#include "ImageContainer.h"
|
||||||
#include "yuv_convert.h"
|
#include "yuv_convert.h"
|
||||||
|
|
||||||
using namespace mozilla::gfx;
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
@ -63,11 +61,11 @@ public:
|
|||||||
already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
|
already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
|
||||||
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
|
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
|
||||||
|
|
||||||
IntSize GetSize() { return mSize; }
|
mozilla::gfx::IntSize GetSize() { return mSize; }
|
||||||
|
|
||||||
TextureD3D10BackendData *GetD3D10TextureBackendData(ID3D10Device *aDevice);
|
TextureD3D10BackendData *GetD3D10TextureBackendData(ID3D10Device *aDevice);
|
||||||
|
|
||||||
IntSize mSize;
|
mozilla::gfx::IntSize mSize;
|
||||||
RemoteImageData::Format mFormat;
|
RemoteImageData::Format mFormat;
|
||||||
HANDLE mHandle;
|
HANDLE mHandle;
|
||||||
};
|
};
|
||||||
|
@ -194,7 +194,7 @@ nsSurfaceTexture::~nsSurfaceTexture()
|
|||||||
JNIEnv* env = GetJNIForThread();
|
JNIEnv* env = GetJNIForThread();
|
||||||
|
|
||||||
if (mSurfaceTexture) {
|
if (mSurfaceTexture) {
|
||||||
GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture);
|
mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture);
|
||||||
|
|
||||||
env->DeleteGlobalRef(mSurfaceTexture);
|
env->DeleteGlobalRef(mSurfaceTexture);
|
||||||
mSurfaceTexture = nullptr;
|
mSurfaceTexture = nullptr;
|
||||||
@ -223,9 +223,9 @@ void
|
|||||||
nsSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable)
|
nsSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable)
|
||||||
{
|
{
|
||||||
if (aRunnable)
|
if (aRunnable)
|
||||||
GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID);
|
mozilla::widget::android::GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID);
|
||||||
else
|
else
|
||||||
GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture);
|
mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture);
|
||||||
|
|
||||||
mFrameAvailableCallback = aRunnable;
|
mFrameAvailableCallback = aRunnable;
|
||||||
}
|
}
|
||||||
|
@ -55,19 +55,19 @@ CancelVibrate(const WindowIdentifier &)
|
|||||||
{
|
{
|
||||||
// Ignore WindowIdentifier parameter.
|
// Ignore WindowIdentifier parameter.
|
||||||
|
|
||||||
GeckoAppShell::CancelVibrate();
|
mozilla::widget::android::GeckoAppShell::CancelVibrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EnableBatteryNotifications()
|
EnableBatteryNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableBatteryNotifications();
|
mozilla::widget::android::GeckoAppShell::EnableBatteryNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableBatteryNotifications()
|
DisableBatteryNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::DisableBatteryNotifications();
|
mozilla::widget::android::GeckoAppShell::DisableBatteryNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -79,13 +79,13 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
|
|||||||
void
|
void
|
||||||
EnableNetworkNotifications()
|
EnableNetworkNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableNetworkNotifications();
|
mozilla::widget::android::GeckoAppShell::EnableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableNetworkNotifications()
|
DisableNetworkNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::DisableNetworkNotifications();
|
mozilla::widget::android::GeckoAppShell::DisableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -97,13 +97,13 @@ GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo)
|
|||||||
void
|
void
|
||||||
EnableScreenConfigurationNotifications()
|
EnableScreenConfigurationNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::EnableScreenOrientationNotifications();
|
mozilla::widget::android::GeckoAppShell::EnableScreenOrientationNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableScreenConfigurationNotifications()
|
DisableScreenConfigurationNotifications()
|
||||||
{
|
{
|
||||||
GeckoAppShell::DisableScreenOrientationNotifications();
|
mozilla::widget::android::GeckoAppShell::DisableScreenOrientationNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -149,7 +149,7 @@ LockScreenOrientation(const ScreenOrientation& aOrientation)
|
|||||||
case eScreenOrientation_LandscapeSecondary:
|
case eScreenOrientation_LandscapeSecondary:
|
||||||
case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
|
case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
|
||||||
case eScreenOrientation_Default:
|
case eScreenOrientation_Default:
|
||||||
GeckoAppShell::LockScreenOrientation(aOrientation);
|
mozilla::widget::android::GeckoAppShell::LockScreenOrientation(aOrientation);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -159,7 +159,7 @@ LockScreenOrientation(const ScreenOrientation& aOrientation)
|
|||||||
void
|
void
|
||||||
UnlockScreenOrientation()
|
UnlockScreenOrientation()
|
||||||
{
|
{
|
||||||
GeckoAppShell::UnlockScreenOrientation();
|
mozilla::widget::android::GeckoAppShell::UnlockScreenOrientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // hal_impl
|
} // hal_impl
|
||||||
|
@ -13,12 +13,12 @@ namespace hal_impl {
|
|||||||
|
|
||||||
void
|
void
|
||||||
EnableSensorNotifications(SensorType aSensor) {
|
EnableSensorNotifications(SensorType aSensor) {
|
||||||
GeckoAppShell::EnableSensor(aSensor);
|
mozilla::widget::android::GeckoAppShell::EnableSensor(aSensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableSensorNotifications(SensorType aSensor) {
|
DisableSensorNotifications(SensorType aSensor) {
|
||||||
GeckoAppShell::DisableSensor(aSensor);
|
mozilla::widget::android::GeckoAppShell::DisableSensor(aSensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // hal_impl
|
} // hal_impl
|
||||||
|
@ -106,7 +106,7 @@ MessagePump::Run(MessagePump::Delegate* aDelegate)
|
|||||||
// get here if the normal Gecko event loop has been awoken above.
|
// get here if the normal Gecko event loop has been awoken above.
|
||||||
// Bug 750713
|
// Bug 750713
|
||||||
if (MOZ_LIKELY(AndroidBridge::HasEnv())) {
|
if (MOZ_LIKELY(AndroidBridge::HasEnv())) {
|
||||||
did_work |= GeckoAppShell::PumpMessageLoop();
|
did_work |= mozilla::widget::android::GeckoAppShell::PumpMessageLoop();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace CSF
|
namespace CSF
|
||||||
{
|
{
|
||||||
class AudioControl;
|
class AudioControl;
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIObserverService> observerService =
|
nsCOMPtr<nsIObserverService> observerService =
|
||||||
mozilla::services::GetObserverService();
|
services::GetObserverService();
|
||||||
if (!observerService)
|
if (!observerService)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ public:
|
|||||||
virtual ~PeerConnectionCtxShutdown()
|
virtual ~PeerConnectionCtxShutdown()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIObserverService> observerService =
|
nsCOMPtr<nsIObserverService> observerService =
|
||||||
mozilla::services::GetObserverService();
|
services::GetObserverService();
|
||||||
if (observerService)
|
if (observerService)
|
||||||
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
|
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
sipcc::PeerConnectionCtx::Destroy();
|
sipcc::PeerConnectionCtx::Destroy();
|
||||||
|
|
||||||
nsCOMPtr<nsIObserverService> observerService =
|
nsCOMPtr<nsIObserverService> observerService =
|
||||||
mozilla::services::GetObserverService();
|
services::GetObserverService();
|
||||||
if (!observerService)
|
if (!observerService)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
@ -162,11 +162,12 @@ public:
|
|||||||
NS_IMPL_ISUPPORTS1(PeerConnectionCtxShutdown, nsIObserver);
|
NS_IMPL_ISUPPORTS1(PeerConnectionCtxShutdown, nsIObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
namespace sipcc {
|
namespace sipcc {
|
||||||
|
|
||||||
PeerConnectionCtx* PeerConnectionCtx::gInstance;
|
PeerConnectionCtx* PeerConnectionCtx::gInstance;
|
||||||
nsIThread* PeerConnectionCtx::gMainThread;
|
nsIThread* PeerConnectionCtx::gMainThread;
|
||||||
StaticRefPtr<mozilla::PeerConnectionCtxShutdown> PeerConnectionCtx::gPeerConnectionCtxShutdown;
|
StaticRefPtr<PeerConnectionCtxShutdown> PeerConnectionCtx::gPeerConnectionCtxShutdown;
|
||||||
|
|
||||||
// Since we have a pointer to main-thread, help make it safe for lower-level
|
// Since we have a pointer to main-thread, help make it safe for lower-level
|
||||||
// SIPCC threads to use SyncRunnable without deadlocking, by exposing main's
|
// SIPCC threads to use SyncRunnable without deadlocking, by exposing main's
|
||||||
@ -293,7 +294,7 @@ nsresult PeerConnectionCtx::Initialize() {
|
|||||||
mDevice = mCCM->getActiveDevice();
|
mDevice = mCCM->getActiveDevice();
|
||||||
mCCM->addCCObserver(this);
|
mCCM->addCCObserver(this);
|
||||||
NS_ENSURE_TRUE(mDevice.get(), NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(mDevice.get(), NS_ERROR_FAILURE);
|
||||||
ChangeSipccState(mozilla::dom::PCImplSipccState::Starting);
|
ChangeSipccState(dom::PCImplSipccState::Starting);
|
||||||
|
|
||||||
// Now that everything is set up, we let the CCApp thread
|
// Now that everything is set up, we let the CCApp thread
|
||||||
// know that it's okay to start processing messages.
|
// know that it's okay to start processing messages.
|
||||||
@ -328,7 +329,7 @@ void PeerConnectionCtx::onDeviceEvent(ccapi_device_event_e aDeviceEvent,
|
|||||||
cc_service_state_t state = aInfo->getServiceState();
|
cc_service_state_t state = aInfo->getServiceState();
|
||||||
// We are keeping this in a local var to avoid a data race
|
// We are keeping this in a local var to avoid a data race
|
||||||
// with ChangeSipccState in the debug message and compound if below
|
// with ChangeSipccState in the debug message and compound if below
|
||||||
mozilla::dom::PCImplSipccState currentSipccState = mSipccState;
|
dom::PCImplSipccState currentSipccState = mSipccState;
|
||||||
|
|
||||||
switch (aDeviceEvent) {
|
switch (aDeviceEvent) {
|
||||||
case CCAPI_DEVICE_EV_STATE:
|
case CCAPI_DEVICE_EV_STATE:
|
||||||
@ -337,9 +338,9 @@ void PeerConnectionCtx::onDeviceEvent(ccapi_device_event_e aDeviceEvent,
|
|||||||
|
|
||||||
if (CC_STATE_INS == state) {
|
if (CC_STATE_INS == state) {
|
||||||
// SIPCC is up
|
// SIPCC is up
|
||||||
if (mozilla::dom::PCImplSipccState::Starting == currentSipccState ||
|
if (dom::PCImplSipccState::Starting == currentSipccState ||
|
||||||
mozilla::dom::PCImplSipccState::Idle == currentSipccState) {
|
dom::PCImplSipccState::Idle == currentSipccState) {
|
||||||
ChangeSipccState(mozilla::dom::PCImplSipccState::Started);
|
ChangeSipccState(dom::PCImplSipccState::Started);
|
||||||
} else {
|
} else {
|
||||||
CSFLogError(logTag, "%s PeerConnection already started", __FUNCTION__);
|
CSFLogError(logTag, "%s PeerConnection already started", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,6 @@ protected:
|
|||||||
|
|
||||||
namespace sipcc {
|
namespace sipcc {
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
|
|
||||||
class OnCallEventArgs {
|
class OnCallEventArgs {
|
||||||
public:
|
public:
|
||||||
OnCallEventArgs(ccapi_call_event_e aCallEvent, CSF::CC_CallInfoPtr aInfo)
|
OnCallEventArgs(ccapi_call_event_e aCallEvent, CSF::CC_CallInfoPtr aInfo)
|
||||||
@ -111,7 +109,7 @@ class PeerConnectionCtx : public CSF::CC_Observer {
|
|||||||
static PeerConnectionCtx *gInstance;
|
static PeerConnectionCtx *gInstance;
|
||||||
public:
|
public:
|
||||||
static nsIThread *gMainThread;
|
static nsIThread *gMainThread;
|
||||||
static StaticRefPtr<mozilla::PeerConnectionCtxShutdown> gPeerConnectionCtxShutdown;
|
static mozilla::StaticRefPtr<mozilla::PeerConnectionCtxShutdown> gPeerConnectionCtxShutdown;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sipcc
|
} // namespace sipcc
|
||||||
|
@ -31,7 +31,6 @@ class nsIDOMWindow;
|
|||||||
class nsIDOMDataChannel;
|
class nsIDOMDataChannel;
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
using namespace mozilla::dom;
|
|
||||||
|
|
||||||
class AFakePCObserver : public nsSupportsWeakReference
|
class AFakePCObserver : public nsSupportsWeakReference
|
||||||
{
|
{
|
||||||
@ -81,7 +80,7 @@ public:
|
|||||||
virtual NS_IMETHODIMP NotifyConnection(ER&) = 0;
|
virtual NS_IMETHODIMP NotifyConnection(ER&) = 0;
|
||||||
virtual NS_IMETHODIMP NotifyClosedConnection(ER&) = 0;
|
virtual NS_IMETHODIMP NotifyClosedConnection(ER&) = 0;
|
||||||
virtual NS_IMETHODIMP NotifyDataChannel(nsIDOMDataChannel *channel, ER&) = 0;
|
virtual NS_IMETHODIMP NotifyDataChannel(nsIDOMDataChannel *channel, ER&) = 0;
|
||||||
virtual NS_IMETHODIMP OnStateChange(PCObserverStateType state_type, ER&,
|
virtual NS_IMETHODIMP OnStateChange(mozilla::dom::PCObserverStateType state_type, ER&,
|
||||||
void* = nullptr) = 0;
|
void* = nullptr) = 0;
|
||||||
virtual NS_IMETHODIMP OnAddStream(nsIDOMMediaStream *stream, ER&) = 0;
|
virtual NS_IMETHODIMP OnAddStream(nsIDOMMediaStream *stream, ER&) = 0;
|
||||||
virtual NS_IMETHODIMP OnRemoveStream(ER&) = 0;
|
virtual NS_IMETHODIMP OnRemoveStream(ER&) = 0;
|
||||||
|
@ -63,7 +63,7 @@ nsAndroidHistory::RegisterVisitedCallback(nsIURI *aURI, Link *aContent)
|
|||||||
list->AppendElement(aContent);
|
list->AppendElement(aContent);
|
||||||
|
|
||||||
if (AndroidBridge::HasEnv()) {
|
if (AndroidBridge::HasEnv()) {
|
||||||
GeckoAppShell::CheckURIVisited(uriString);
|
mozilla::widget::android::GeckoAppShell::CheckURIVisited(uriString);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -180,7 +180,7 @@ nsAndroidHistory::VisitURI(nsIURI *aURI, nsIURI *aLastVisitedURI, uint32_t aFlag
|
|||||||
rv = aURI->GetSpec(uri);
|
rv = aURI->GetSpec(uri);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
NS_ConvertUTF8toUTF16 uriString(uri);
|
NS_ConvertUTF8toUTF16 uriString(uri);
|
||||||
GeckoAppShell::MarkURIVisited(uriString);
|
mozilla::widget::android::GeckoAppShell::MarkURIVisited(uriString);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppendToRecentlyVisitedURIs(aURI);
|
AppendToRecentlyVisitedURIs(aURI);
|
||||||
@ -215,7 +215,7 @@ nsAndroidHistory::SetURITitle(nsIURI *aURI, const nsAString& aTitle)
|
|||||||
nsresult rv = aURI->GetSpec(uri);
|
nsresult rv = aURI->GetSpec(uri);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
NS_ConvertUTF8toUTF16 uriString(uri);
|
NS_ConvertUTF8toUTF16 uriString(uri);
|
||||||
GeckoAppShell::SetURITitle(uriString, aTitle);
|
mozilla::widget::android::GeckoAppShell::SetURITitle(uriString, aTitle);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,12 @@ nsShellService::SwitchTask()
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsShellService::CreateShortcut(const nsAString& aTitle, const nsAString& aURI, const nsAString& aIconData, const nsAString& aIntent)
|
nsShellService::CreateShortcut(const nsAString& aTitle, const nsAString& aURI,
|
||||||
|
const nsAString& aIconData, const nsAString& aIntent)
|
||||||
{
|
{
|
||||||
if (!aTitle.Length() || !aURI.Length() || !aIconData.Length())
|
if (!aTitle.Length() || !aURI.Length() || !aIconData.Length())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
GeckoAppShell::CreateShortcut(aTitle, aURI, aIconData, aIntent);
|
mozilla::widget::android::GeckoAppShell::CreateShortcut(aTitle, aURI, aIconData, aIntent);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ Tickler::Init()
|
|||||||
MOZ_ASSERT(!mFD);
|
MOZ_ASSERT(!mFD);
|
||||||
|
|
||||||
if (AndroidBridge::HasEnv()) {
|
if (AndroidBridge::HasEnv()) {
|
||||||
GeckoAppShell::EnableNetworkNotifications();
|
mozilla::widget::android::GeckoAppShell::EnableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
mFD = PR_OpenUDPSocket(PR_AF_INET);
|
mFD = PR_OpenUDPSocket(PR_AF_INET);
|
||||||
|
@ -90,7 +90,7 @@ bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CameraStreamImpl::Close() {
|
void CameraStreamImpl::Close() {
|
||||||
GeckoAppShell::CloseCamera();
|
mozilla::widget::android::GeckoAppShell::CloseCamera();
|
||||||
mCallback = nullptr;
|
mCallback = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aIsUp = GeckoAppShell::IsNetworkLinkUp();
|
*aIsUp = mozilla::widget::android::GeckoAppShell::IsNetworkLinkUp();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown)
|
|||||||
{
|
{
|
||||||
NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED);
|
NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED);
|
||||||
|
|
||||||
*aIsKnown = GeckoAppShell::IsNetworkLinkKnown();
|
*aIsKnown = mozilla::widget::android::GeckoAppShell::IsNetworkLinkKnown();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +58,6 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aLinkType = GeckoAppShell::NetworkLinkType();
|
*aLinkType = mozilla::widget::android::GeckoAppShell::NetworkLinkType();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
GeckoAppShell::CloseNotification(aAlertName);
|
mozilla::widget::android::GeckoAppShell::CloseNotification(aAlertName);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -149,7 +149,9 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
|
|||||||
const nsAString & aAlertText)
|
const nsAString & aAlertText)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName, aProgress, aProgressMax, aAlertText);
|
mozilla::widget::android::GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName,
|
||||||
|
aProgress, aProgressMax,
|
||||||
|
aAlertText);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
@ -159,7 +161,7 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
|
|||||||
NS_IMETHODIMP nsAlertsService::OnCancel(const nsAString & aAlertName)
|
NS_IMETHODIMP nsAlertsService::OnCancel(const nsAString & aAlertName)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
GeckoAppShell::CloseNotification(aAlertName);
|
mozilla::widget::android::GeckoAppShell::CloseNotification(aAlertName);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
@ -2822,7 +2822,7 @@ nsDownload::SetState(DownloadState aState)
|
|||||||
if (mimeInfo)
|
if (mimeInfo)
|
||||||
mimeInfo->GetMIMEType(contentType);
|
mimeInfo->GetMIMEType(contentType);
|
||||||
|
|
||||||
GeckoAppShell::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
|
mozilla::widget::android::GeckoAppShell::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,8 @@ typename Builder::Object BuildJavaThreadJSObject(Builder& b)
|
|||||||
b.DefineProperty(sample, "frames", frames);
|
b.DefineProperty(sample, "frames", frames);
|
||||||
b.ArrayPush(samples, sample);
|
b.ArrayPush(samples, sample);
|
||||||
|
|
||||||
double sampleTime = GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
|
double sampleTime =
|
||||||
|
mozilla::widget::android::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
|
||||||
b.DefineProperty(sample, "time", sampleTime);
|
b.DefineProperty(sample, "time", sampleTime);
|
||||||
}
|
}
|
||||||
typename Builder::RootedObject frame(b.context(), b.CreateObject());
|
typename Builder::RootedObject frame(b.context(), b.CreateObject());
|
||||||
@ -282,12 +283,12 @@ void TableTicker::BuildJSObject(Builder& b, typename Builder::ObjectHandle profi
|
|||||||
|
|
||||||
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
||||||
if (ProfileJava()) {
|
if (ProfileJava()) {
|
||||||
GeckoJavaSampler::PauseJavaProfiling();
|
mozilla::widget::android::GeckoJavaSampler::PauseJavaProfiling();
|
||||||
|
|
||||||
typename Builder::RootedObject javaThread(b.context(), BuildJavaThreadJSObject(b));
|
typename Builder::RootedObject javaThread(b.context(), BuildJavaThreadJSObject(b));
|
||||||
b.ArrayPush(threads, javaThread);
|
b.ArrayPush(threads, javaThread);
|
||||||
|
|
||||||
GeckoJavaSampler::UnpauseJavaProfiling();
|
mozilla::widget::android::GeckoJavaSampler::UnpauseJavaProfiling();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
|
|||||||
if (javaInterval < 10) {
|
if (javaInterval < 10) {
|
||||||
aInterval = 10;
|
aInterval = 10;
|
||||||
}
|
}
|
||||||
GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
|
mozilla::widget::android::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,14 +69,15 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC
|
|||||||
{
|
{
|
||||||
nsCString uriSpec;
|
nsCString uriSpec;
|
||||||
aURI->GetSpec(uriSpec);
|
aURI->GetSpec(uriSpec);
|
||||||
return GeckoAppShell::OpenUriExternal(NS_ConvertUTF8toUTF16(uriSpec), NS_ConvertUTF8toUTF16(mMimeType), mPackageName, mClassName, mAction) ?
|
return mozilla::widget::android::GeckoAppShell::OpenUriExternal
|
||||||
|
(NS_ConvertUTF8toUTF16(uriSpec), NS_ConvertUTF8toUTF16(mMimeType), mPackageName, mClassName, mAction) ?
|
||||||
NS_OK : NS_ERROR_FAILURE;
|
NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
|
nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
|
||||||
{
|
{
|
||||||
return GeckoAppShell::OpenUriExternal(data, NS_ConvertUTF8toUTF16(mMimeType), mPackageName,
|
return mozilla::widget::android::GeckoAppShell::OpenUriExternal(data, NS_ConvertUTF8toUTF16(mMimeType),
|
||||||
mClassName, mAction) ? NS_OK : NS_ERROR_FAILURE;
|
mPackageName, mClassName, mAction) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@ nsExternalSharingAppService::ShareWithDefault(const nsAString & data,
|
|||||||
{
|
{
|
||||||
NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
|
NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
|
||||||
const nsString emptyString = EmptyString();
|
const nsString emptyString = EmptyString();
|
||||||
return GeckoAppShell::OpenUriExternal(data, mime, emptyString,emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
|
return mozilla::widget::android::GeckoAppShell::OpenUriExternal(data,
|
||||||
|
mime, emptyString,emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -30,7 +30,9 @@ nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI)
|
|||||||
nsCString uriScheme;
|
nsCString uriScheme;
|
||||||
aURI->GetScheme(uriScheme);
|
aURI->GetScheme(uriScheme);
|
||||||
|
|
||||||
return GeckoAppShell::OpenUriExternal(NS_ConvertUTF8toUTF16(uriSpec), (mType.Equals(uriScheme) || mType.Equals(uriSpec)) ? EmptyString() : NS_ConvertUTF8toUTF16(mType)) ? NS_OK : NS_ERROR_FAILURE;
|
return mozilla::widget::android::GeckoAppShell::OpenUriExternal(NS_ConvertUTF8toUTF16(uriSpec),
|
||||||
|
(mType.Equals(uriScheme) || mType.Equals(uriSpec)) ?
|
||||||
|
EmptyString() : NS_ConvertUTF8toUTF16(mType)) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -342,7 +342,8 @@ AndroidBridge::GetHandlersForMimeType(const nsAString& aMimeType,
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jobjectArray arr = GeckoAppShell::GetHandlersForMimeTypeWrapper(aMimeType, aAction);
|
jobjectArray arr =
|
||||||
|
mozilla::widget::android::GeckoAppShell::GetHandlersForMimeTypeWrapper(aMimeType, aAction);
|
||||||
if (!arr)
|
if (!arr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -368,7 +369,7 @@ AndroidBridge::GetHandlersForURL(const nsAString& aURL,
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jobjectArray arr = GeckoAppShell::GetHandlersForURLWrapper(aURL, aAction);
|
jobjectArray arr = mozilla::widget::android::GeckoAppShell::GetHandlersForURLWrapper(aURL, aAction);
|
||||||
if (!arr)
|
if (!arr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -390,7 +391,8 @@ AndroidBridge::GetMimeTypeFromExtensions(const nsACString& aFileExt, nsCString&
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jstring jstrType = GeckoAppShell::GetMimeTypeFromExtensionsWrapper(NS_ConvertUTF8toUTF16(aFileExt));
|
jstring jstrType = mozilla::widget::android::GeckoAppShell::GetMimeTypeFromExtensionsWrapper
|
||||||
|
(NS_ConvertUTF8toUTF16(aFileExt));
|
||||||
if (!jstrType) {
|
if (!jstrType) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -406,7 +408,8 @@ AndroidBridge::GetExtensionFromMimeType(const nsACString& aMimeType, nsACString&
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jstring jstrExt = GeckoAppShell::GetExtensionFromMimeTypeWrapper(NS_ConvertUTF8toUTF16(aMimeType));
|
jstring jstrExt = mozilla::widget::android::GeckoAppShell::GetExtensionFromMimeTypeWrapper
|
||||||
|
(NS_ConvertUTF8toUTF16(aMimeType));
|
||||||
if (!jstrExt) {
|
if (!jstrExt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -444,7 +447,8 @@ AndroidBridge::ShowAlertNotification(const nsAString& aImageUrl,
|
|||||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeAddObserver(aAlertName, aAlertListener));
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeAddObserver(aAlertName, aAlertListener));
|
||||||
}
|
}
|
||||||
|
|
||||||
GeckoAppShell::ShowAlertNotificationWrapper(aImageUrl, aAlertTitle, aAlertText, aAlertCookie, aAlertName);
|
mozilla::widget::android::GeckoAppShell::ShowAlertNotificationWrapper
|
||||||
|
(aImageUrl, aAlertTitle, aAlertText, aAlertCookie, aAlertName);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -456,7 +460,7 @@ AndroidBridge::GetDPI()
|
|||||||
|
|
||||||
const int DEFAULT_DPI = 160;
|
const int DEFAULT_DPI = 160;
|
||||||
|
|
||||||
sDPI = GeckoAppShell::GetDpiWrapper();
|
sDPI = mozilla::widget::android::GeckoAppShell::GetDpiWrapper();
|
||||||
if (!sDPI) {
|
if (!sDPI) {
|
||||||
return DEFAULT_DPI;
|
return DEFAULT_DPI;
|
||||||
}
|
}
|
||||||
@ -476,14 +480,13 @@ AndroidBridge::GetScreenDepth()
|
|||||||
const int DEFAULT_DEPTH = 16;
|
const int DEFAULT_DEPTH = 16;
|
||||||
|
|
||||||
if (HasEnv()) {
|
if (HasEnv()) {
|
||||||
sDepth = GeckoAppShell::GetScreenDepthWrapper();
|
sDepth = mozilla::widget::android::GeckoAppShell::GetScreenDepthWrapper();
|
||||||
}
|
}
|
||||||
if (!sDepth)
|
if (!sDepth)
|
||||||
return DEFAULT_DEPTH;
|
return DEFAULT_DEPTH;
|
||||||
|
|
||||||
return sDepth;
|
return sDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AndroidBridge::Vibrate(const nsTArray<uint32_t>& aPattern)
|
AndroidBridge::Vibrate(const nsTArray<uint32_t>& aPattern)
|
||||||
{
|
{
|
||||||
@ -507,7 +510,7 @@ AndroidBridge::Vibrate(const nsTArray<uint32_t>& aPattern)
|
|||||||
ALOG_BRIDGE(" invalid vibration duration < 0");
|
ALOG_BRIDGE(" invalid vibration duration < 0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GeckoAppShell::Vibrate1(d);
|
mozilla::widget::android::GeckoAppShell::Vibrate1(d);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +536,7 @@ AndroidBridge::Vibrate(const nsTArray<uint32_t>& aPattern)
|
|||||||
}
|
}
|
||||||
env->ReleaseLongArrayElements(array, elts, 0);
|
env->ReleaseLongArrayElements(array, elts, 0);
|
||||||
|
|
||||||
GeckoAppShell::VibrateA(array, -1/*don't repeat*/);
|
mozilla::widget::android::GeckoAppShell::VibrateA(array, -1/*don't repeat*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -548,7 +551,7 @@ AndroidBridge::GetSystemColors(AndroidSystemColors *aColors)
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
|
|
||||||
jintArray arr = GeckoAppShell::GetSystemColoursWrapper();
|
jintArray arr = mozilla::widget::android::GeckoAppShell::GetSystemColoursWrapper();
|
||||||
if (!arr)
|
if (!arr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -584,7 +587,8 @@ AndroidBridge::GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSiz
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
|
|
||||||
jbyteArray arr = GeckoAppShell::GetIconForExtensionWrapper(NS_ConvertUTF8toUTF16(aFileExt), aIconSize);
|
jbyteArray arr = mozilla::widget::android::GeckoAppShell::GetIconForExtensionWrapper
|
||||||
|
(NS_ConvertUTF8toUTF16(aFileExt), aIconSize);
|
||||||
|
|
||||||
NS_ASSERTION(arr != nullptr, "AndroidBridge::GetIconForExtension: Returned pixels array is null!");
|
NS_ASSERTION(arr != nullptr, "AndroidBridge::GetIconForExtension: Returned pixels array is null!");
|
||||||
if (!arr)
|
if (!arr)
|
||||||
@ -616,7 +620,7 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj)
|
|||||||
mLayerClient = nullptr;
|
mLayerClient = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
mLayerClient = GeckoLayerClient::Wrap(jobj);
|
mLayerClient = mozilla::widget::android::GeckoLayerClient::Wrap(jobj);
|
||||||
|
|
||||||
if (resetting) {
|
if (resetting) {
|
||||||
// since we are re-linking the new java objects to Gecko, we need to get
|
// since we are re-linking the new java objects to Gecko, we need to get
|
||||||
@ -918,7 +922,8 @@ AndroidBridge::InitCamera(const nsCString& contentType, uint32_t camera, uint32_
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jintArray arr = GeckoAppShell::InitCameraWrapper(NS_ConvertUTF8toUTF16(contentType), (int32_t) camera, (int32_t) width, (int32_t) height);
|
jintArray arr = mozilla::widget::android::GeckoAppShell::InitCameraWrapper
|
||||||
|
(NS_ConvertUTF8toUTF16(contentType), (int32_t) camera, (int32_t) width, (int32_t) height);
|
||||||
|
|
||||||
if (!arr)
|
if (!arr)
|
||||||
return false;
|
return false;
|
||||||
@ -947,7 +952,7 @@ AndroidBridge::GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInf
|
|||||||
|
|
||||||
// To prevent calling too many methods through JNI, the Java method returns
|
// To prevent calling too many methods through JNI, the Java method returns
|
||||||
// an array of double even if we actually want a double and a boolean.
|
// an array of double even if we actually want a double and a boolean.
|
||||||
jdoubleArray arr = GeckoAppShell::GetCurrentBatteryInformationWrapper();
|
jdoubleArray arr = mozilla::widget::android::GeckoAppShell::GetCurrentBatteryInformationWrapper();
|
||||||
if (!arr || env->GetArrayLength(arr) != 3) {
|
if (!arr || env->GetArrayLength(arr) != 3) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -969,7 +974,7 @@ AndroidBridge::HandleGeckoMessage(const nsAString &aMessage)
|
|||||||
JNIEnv *env = GetJNIEnv();
|
JNIEnv *env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
GeckoAppShell::HandleGeckoMessageWrapper(aMessage);
|
mozilla::widget::android::GeckoAppShell::HandleGeckoMessageWrapper(aMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -1027,7 +1032,7 @@ AndroidBridge::SendMessage(const nsAString& aNumber,
|
|||||||
if (!QueueSmsRequest(aRequest, &requestId))
|
if (!QueueSmsRequest(aRequest, &requestId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::SendMessageWrapper(aNumber, aMessage, requestId);
|
mozilla::widget::android::GeckoAppShell::SendMessageWrapper(aNumber, aMessage, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1039,7 +1044,7 @@ AndroidBridge::GetMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequest
|
|||||||
if (!QueueSmsRequest(aRequest, &requestId))
|
if (!QueueSmsRequest(aRequest, &requestId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::GetMessageWrapper(aMessageId, requestId);
|
mozilla::widget::android::GeckoAppShell::GetMessageWrapper(aMessageId, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1051,7 +1056,7 @@ AndroidBridge::DeleteMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequ
|
|||||||
if (!QueueSmsRequest(aRequest, &requestId))
|
if (!QueueSmsRequest(aRequest, &requestId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::DeleteMessageWrapper(aMessageId, requestId);
|
mozilla::widget::android::GeckoAppShell::DeleteMessageWrapper(aMessageId, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1079,8 +1084,8 @@ AndroidBridge::CreateMessageList(const dom::mobilemessage::SmsFilterData& aFilte
|
|||||||
env->DeleteLocalRef(elem);
|
env->DeleteLocalRef(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeckoAppShell::CreateMessageListWrapper(aFilter.startDate(), aFilter.endDate(),
|
mozilla::widget::android::GeckoAppShell::CreateMessageListWrapper(aFilter.startDate(),
|
||||||
numbers, aFilter.numbers().Length(),
|
aFilter.endDate(), numbers, aFilter.numbers().Length(),
|
||||||
aFilter.delivery(), aReverse, requestId);
|
aFilter.delivery(), aReverse, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1093,7 +1098,7 @@ AndroidBridge::GetNextMessageInList(int32_t aListId, nsIMobileMessageCallback* a
|
|||||||
if (!QueueSmsRequest(aRequest, &requestId))
|
if (!QueueSmsRequest(aRequest, &requestId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::GetNextMessageInListWrapper(aListId, requestId);
|
mozilla::widget::android::GeckoAppShell::GetNextMessageInListWrapper(aListId, requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -1143,7 +1148,7 @@ AndroidBridge::GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInf
|
|||||||
// To prevent calling too many methods through JNI, the Java method returns
|
// To prevent calling too many methods through JNI, the Java method returns
|
||||||
// an array of double even if we actually want an integer, a boolean, and an integer.
|
// an array of double even if we actually want an integer, a boolean, and an integer.
|
||||||
|
|
||||||
jdoubleArray arr = GeckoAppShell::GetCurrentNetworkInformationWrapper();
|
jdoubleArray arr = mozilla::widget::android::GeckoAppShell::GetCurrentNetworkInformationWrapper();
|
||||||
if (!arr || env->GetArrayLength(arr) != 3) {
|
if (!arr || env->GetArrayLength(arr) != 3) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1329,7 +1334,7 @@ AndroidBridge::GetGlobalContextRef() {
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 4);
|
AutoLocalJNIFrame jniFrame(env, 4);
|
||||||
|
|
||||||
jobject context = GeckoAppShell::GetContext();
|
jobject context = mozilla::widget::android::GeckoAppShell::GetContext();
|
||||||
if (!context) {
|
if (!context) {
|
||||||
ALOG_BRIDGE("%s: Could not GetContext()", __FUNCTION__);
|
ALOG_BRIDGE("%s: Could not GetContext()", __FUNCTION__);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1380,7 +1385,7 @@ AndroidBridge::UnlockWindow(void* window)
|
|||||||
void
|
void
|
||||||
AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLayerScale& aZoom, const CSSRect& aCssPageRect)
|
AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLayerScale& aZoom, const CSSRect& aCssPageRect)
|
||||||
{
|
{
|
||||||
GeckoLayerClient *client = mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *client = mLayerClient;
|
||||||
if (!client)
|
if (!client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1391,7 +1396,7 @@ AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLa
|
|||||||
void
|
void
|
||||||
AndroidBridge::SetPageRect(const CSSRect& aCssPageRect)
|
AndroidBridge::SetPageRect(const CSSRect& aCssPageRect)
|
||||||
{
|
{
|
||||||
GeckoLayerClient *client = mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *client = mLayerClient;
|
||||||
if (!client)
|
if (!client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1403,7 +1408,7 @@ AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLay
|
|||||||
bool aLayersUpdated, ScreenPoint& aScrollOffset, CSSToScreenScale& aScale,
|
bool aLayersUpdated, ScreenPoint& aScrollOffset, CSSToScreenScale& aScale,
|
||||||
LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
|
LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
|
||||||
{
|
{
|
||||||
GeckoLayerClient *client = mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *client = mLayerClient;
|
||||||
if (!client) {
|
if (!client) {
|
||||||
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
||||||
return;
|
return;
|
||||||
@ -1434,7 +1439,7 @@ void AndroidBridge::SyncFrameMetrics(const ScreenPoint& aScrollOffset, float aZo
|
|||||||
bool aLayersUpdated, const CSSRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
|
bool aLayersUpdated, const CSSRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
|
||||||
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
|
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
|
||||||
{
|
{
|
||||||
GeckoLayerClient *client = mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *client = mLayerClient;
|
||||||
if (!client) {
|
if (!client) {
|
||||||
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
||||||
return;
|
return;
|
||||||
@ -1542,7 +1547,7 @@ AndroidBridge::GetScreenOrientation()
|
|||||||
{
|
{
|
||||||
ALOG_BRIDGE("AndroidBridge::GetScreenOrientation");
|
ALOG_BRIDGE("AndroidBridge::GetScreenOrientation");
|
||||||
|
|
||||||
int16_t orientation = GeckoAppShell::GetScreenOrientationWrapper();
|
int16_t orientation = mozilla::widget::android::GeckoAppShell::GetScreenOrientationWrapper();
|
||||||
|
|
||||||
if (!orientation)
|
if (!orientation)
|
||||||
return dom::eScreenOrientation_None;
|
return dom::eScreenOrientation_None;
|
||||||
@ -1569,7 +1574,8 @@ AndroidBridge::GetProxyForURI(const nsACString & aSpec,
|
|||||||
JNIEnv* env = GetJNIEnv();
|
JNIEnv* env = GetJNIEnv();
|
||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
jstring jstrRet = GeckoAppShell::GetProxyForURIWrapper(NS_ConvertUTF8toUTF16(aSpec),
|
jstring jstrRet =
|
||||||
|
mozilla::widget::android::GeckoAppShell::GetProxyForURIWrapper(NS_ConvertUTF8toUTF16(aSpec),
|
||||||
NS_ConvertUTF8toUTF16(aScheme),
|
NS_ConvertUTF8toUTF16(aScheme),
|
||||||
NS_ConvertUTF8toUTF16(aHost),
|
NS_ConvertUTF8toUTF16(aHost),
|
||||||
aPort);
|
aPort);
|
||||||
@ -1605,7 +1611,8 @@ AndroidBridge::AddPluginView(jobject view, const LayoutDeviceRect& rect, bool is
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
CSSRect cssRect = rect / win->GetDefaultScale();
|
CSSRect cssRect = rect / win->GetDefaultScale();
|
||||||
GeckoAppShell::AddPluginViewWrapper(view, cssRect.x, cssRect.y, cssRect.width, cssRect.height, isFullScreen);
|
mozilla::widget::android::GeckoAppShell::AddPluginViewWrapper(view, cssRect.x, cssRect.y,
|
||||||
|
cssRect.width, cssRect.height, isFullScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
@ -1620,7 +1627,8 @@ AndroidBridge::GetThreadNameJavaProfiling(uint32_t aThreadId, nsCString & aResul
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
|
|
||||||
jstring jstrThreadName = GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(aThreadId);
|
jstring jstrThreadName =
|
||||||
|
mozilla::widget::android::GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(aThreadId);
|
||||||
|
|
||||||
if (!jstrThreadName)
|
if (!jstrThreadName)
|
||||||
return false;
|
return false;
|
||||||
@ -1638,7 +1646,8 @@ AndroidBridge::GetFrameNameJavaProfiling(uint32_t aThreadId, uint32_t aSampleId,
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env, 1);
|
AutoLocalJNIFrame jniFrame(env, 1);
|
||||||
|
|
||||||
jstring jstrSampleName = GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(aThreadId, aSampleId, aFrameId);
|
jstring jstrSampleName = mozilla::widget::android::GeckoJavaSampler::GetFrameNameJavaProfilingWrapper
|
||||||
|
(aThreadId, aSampleId, aFrameId);
|
||||||
|
|
||||||
if (!jstrSampleName)
|
if (!jstrSampleName)
|
||||||
return false;
|
return false;
|
||||||
@ -1836,7 +1845,7 @@ AndroidBridge::IsContentDocumentDisplayed()
|
|||||||
bool
|
bool
|
||||||
AndroidBridge::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, ParentLayerRect& aCompositionBounds, CSSToParentLayerScale& aZoom)
|
AndroidBridge::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, ParentLayerRect& aCompositionBounds, CSSToParentLayerScale& aZoom)
|
||||||
{
|
{
|
||||||
GeckoLayerClient *client = mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *client = mLayerClient;
|
||||||
if (!client) {
|
if (!client) {
|
||||||
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
@ -1866,11 +1875,11 @@ AndroidBridge::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
NativePanZoomController*
|
mozilla::widget::android::NativePanZoomController*
|
||||||
AndroidBridge::SetNativePanZoomController(jobject obj)
|
AndroidBridge::SetNativePanZoomController(jobject obj)
|
||||||
{
|
{
|
||||||
NativePanZoomController* old = mNativePanZoomController;
|
mozilla::widget::android::NativePanZoomController* old = mNativePanZoomController;
|
||||||
mNativePanZoomController = NativePanZoomController::Wrap(obj);
|
mNativePanZoomController = mozilla::widget::android::NativePanZoomController::Wrap(obj);
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1897,7 +1906,7 @@ AndroidBridge::HandleDoubleTap(const CSSPoint& aPoint,
|
|||||||
int32_t aModifiers,
|
int32_t aModifiers,
|
||||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||||
{
|
{
|
||||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
NS_LITERAL_CSTRING("Gesture:DoubleTap"), data));
|
NS_LITERAL_CSTRING("Gesture:DoubleTap"), data));
|
||||||
}
|
}
|
||||||
@ -1908,7 +1917,7 @@ AndroidBridge::HandleSingleTap(const CSSPoint& aPoint,
|
|||||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||||
{
|
{
|
||||||
// TODO Send the modifier data to Gecko for use in mouse events.
|
// TODO Send the modifier data to Gecko for use in mouse events.
|
||||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||||
}
|
}
|
||||||
@ -1918,7 +1927,7 @@ AndroidBridge::HandleLongTap(const CSSPoint& aPoint,
|
|||||||
int32_t aModifiers,
|
int32_t aModifiers,
|
||||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||||
{
|
{
|
||||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,6 @@ class Thread;
|
|||||||
|
|
||||||
typedef void* EGLSurface;
|
typedef void* EGLSurface;
|
||||||
|
|
||||||
using namespace mozilla::widget::android;
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
namespace hal {
|
namespace hal {
|
||||||
@ -181,7 +179,7 @@ public:
|
|||||||
jthrowable e = aEnv->ExceptionOccurred();
|
jthrowable e = aEnv->ExceptionOccurred();
|
||||||
MOZ_ASSERT(e);
|
MOZ_ASSERT(e);
|
||||||
aEnv->ExceptionClear();
|
aEnv->ExceptionClear();
|
||||||
GeckoAppShell::HandleUncaughtException(nullptr, e);
|
mozilla::widget::android::GeckoAppShell::HandleUncaughtException(nullptr, e);
|
||||||
// Should be dead by now...
|
// Should be dead by now...
|
||||||
MOZ_CRASH("Failed to handle uncaught exception");
|
MOZ_CRASH("Failed to handle uncaught exception");
|
||||||
}
|
}
|
||||||
@ -202,10 +200,10 @@ public:
|
|||||||
void ContentDocumentChanged();
|
void ContentDocumentChanged();
|
||||||
bool IsContentDocumentDisplayed();
|
bool IsContentDocumentDisplayed();
|
||||||
|
|
||||||
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, ParentLayerRect& aCompositionBounds, CSSToParentLayerScale& aZoom);
|
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, mozilla::ParentLayerRect& aCompositionBounds, mozilla::CSSToParentLayerScale& aZoom);
|
||||||
|
|
||||||
void SetLayerClient(JNIEnv* env, jobject jobj);
|
void SetLayerClient(JNIEnv* env, jobject jobj);
|
||||||
GeckoLayerClient* GetLayerClient() { return mLayerClient; }
|
mozilla::widget::android::GeckoLayerClient* GetLayerClient() { return mLayerClient; }
|
||||||
|
|
||||||
bool GetHandlersForURL(const nsAString& aURL,
|
bool GetHandlersForURL(const nsAString& aURL,
|
||||||
nsIMutableArray* handlersArray = nullptr,
|
nsIMutableArray* handlersArray = nullptr,
|
||||||
@ -356,7 +354,7 @@ protected:
|
|||||||
JNIEnv *mJNIEnv;
|
JNIEnv *mJNIEnv;
|
||||||
pthread_t mThread;
|
pthread_t mThread;
|
||||||
|
|
||||||
GeckoLayerClient *mLayerClient;
|
mozilla::widget::android::GeckoLayerClient *mLayerClient;
|
||||||
|
|
||||||
// the android.telephony.SmsMessage class
|
// the android.telephony.SmsMessage class
|
||||||
jclass mAndroidSmsMessageClass;
|
jclass mAndroidSmsMessageClass;
|
||||||
@ -397,7 +395,7 @@ protected:
|
|||||||
jclass jLayerView;
|
jclass jLayerView;
|
||||||
|
|
||||||
jfieldID jEGLSurfacePointerField;
|
jfieldID jEGLSurfacePointerField;
|
||||||
GLController *mGLControllerObj;
|
mozilla::widget::android::GLController *mGLControllerObj;
|
||||||
|
|
||||||
// some convinient types to have around
|
// some convinient types to have around
|
||||||
jclass jStringClass;
|
jclass jStringClass;
|
||||||
@ -421,14 +419,14 @@ protected:
|
|||||||
void (* Region_set)(void* region, void* rect);
|
void (* Region_set)(void* region, void* rect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NativePanZoomController* mNativePanZoomController;
|
mozilla::widget::android::NativePanZoomController* mNativePanZoomController;
|
||||||
// This will always be accessed from one thread (the APZC "controller"
|
// This will always be accessed from one thread (the APZC "controller"
|
||||||
// thread, which is the Java UI thread), so we don't need to do locking
|
// thread, which is the Java UI thread), so we don't need to do locking
|
||||||
// to touch it
|
// to touch it
|
||||||
nsTArray<DelayedTask*> mDelayedTaskQueue;
|
nsTArray<DelayedTask*> mDelayedTaskQueue;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NativePanZoomController* SetNativePanZoomController(jobject obj);
|
mozilla::widget::android::NativePanZoomController* SetNativePanZoomController(jobject obj);
|
||||||
// GeckoContentController methods
|
// GeckoContentController methods
|
||||||
void RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
void RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
||||||
void AcknowledgeScrollUpdate(const mozilla::layers::FrameMetrics::ViewID& aScrollId,
|
void AcknowledgeScrollUpdate(const mozilla::layers::FrameMetrics::ViewID& aScrollId,
|
||||||
|
@ -47,6 +47,7 @@ using namespace mozilla;
|
|||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::dom::mobilemessage;
|
using namespace mozilla::dom::mobilemessage;
|
||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
|
using namespace mozilla::widget::android;
|
||||||
|
|
||||||
/* Forward declare all the JNI methods as extern "C" */
|
/* Forward declare all the JNI methods as extern "C" */
|
||||||
|
|
||||||
|
@ -82,20 +82,20 @@ public:
|
|||||||
nsCOMPtr<nsIBrowserTab> tab;
|
nsCOMPtr<nsIBrowserTab> tab;
|
||||||
mBrowserApp->GetBrowserTab(mTabId, getter_AddRefs(tab));
|
mBrowserApp->GetBrowserTab(mTabId, getter_AddRefs(tab));
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
ThumbnailHelper::SendThumbnail(buffer, mTabId, false);
|
mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, false);
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tab->GetWindow(getter_AddRefs(domWindow));
|
tab->GetWindow(getter_AddRefs(domWindow));
|
||||||
if (!domWindow) {
|
if (!domWindow) {
|
||||||
ThumbnailHelper::SendThumbnail(buffer, mTabId, false);
|
mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, false);
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(mPoints.Length() == 1, "Thumbnail event does not have enough coordinates");
|
NS_ASSERTION(mPoints.Length() == 1, "Thumbnail event does not have enough coordinates");
|
||||||
|
|
||||||
nsresult rv = AndroidBridge::Bridge()->CaptureThumbnail(domWindow, mPoints[0].x, mPoints[0].y, mTabId, buffer);
|
nsresult rv = AndroidBridge::Bridge()->CaptureThumbnail(domWindow, mPoints[0].x, mPoints[0].y, mTabId, buffer);
|
||||||
ThumbnailHelper::SendThumbnail(buffer, mTabId, NS_SUCCEEDED(rv));
|
mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, NS_SUCCEEDED(rv));
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -110,7 +110,7 @@ class WakeLockListener MOZ_FINAL : public nsIDOMMozWakeLockListener {
|
|||||||
NS_DECL_ISUPPORTS;
|
NS_DECL_ISUPPORTS;
|
||||||
|
|
||||||
nsresult Callback(const nsAString& topic, const nsAString& state) {
|
nsresult Callback(const nsAString& topic, const nsAString& state) {
|
||||||
GeckoAppShell::NotifyWakeLockChanged(topic, state);
|
mozilla::widget::android::GeckoAppShell::NotifyWakeLockChanged(topic, state);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -599,7 +599,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (curEvent->AckNeeded()) {
|
if (curEvent->AckNeeded()) {
|
||||||
GeckoAppShell::AcknowledgeEvent();
|
mozilla::widget::android::GeckoAppShell::AcknowledgeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
EVLOG("nsAppShell: -- done event %p %d", (void*)curEvent.get(), curEvent->Type());
|
EVLOG("nsAppShell: -- done event %p %d", (void*)curEvent.get(), curEvent->Type());
|
||||||
|
@ -43,8 +43,7 @@ nsClipboard::SetData(nsITransferable *aTransferable,
|
|||||||
nsAutoString buffer;
|
nsAutoString buffer;
|
||||||
supportsString->GetData(buffer);
|
supportsString->GetData(buffer);
|
||||||
|
|
||||||
Clipboard::SetClipboardText(buffer);
|
mozilla::widget::android::Clipboard::SetClipboardText(buffer);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard)
|
|||||||
{
|
{
|
||||||
if (aWhichClipboard != kGlobalClipboard)
|
if (aWhichClipboard != kGlobalClipboard)
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
Clipboard::ClearText();
|
mozilla::widget::android::Clipboard::ClearText();
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -98,7 +97,7 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList,
|
|||||||
*aHasText = false;
|
*aHasText = false;
|
||||||
if (aWhichClipboard != kGlobalClipboard)
|
if (aWhichClipboard != kGlobalClipboard)
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
*aHasText = Clipboard::HasText();
|
*aHasText = mozilla::widget::android::Clipboard::HasText();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,6 @@ nsIMEPicker::~nsIMEPicker()
|
|||||||
/* void show (); */
|
/* void show (); */
|
||||||
NS_IMETHODIMP nsIMEPicker::Show()
|
NS_IMETHODIMP nsIMEPicker::Show()
|
||||||
{
|
{
|
||||||
GeckoAppShell::ShowInputMethodPicker();
|
mozilla::widget::android::GeckoAppShell::ShowInputMethodPicker();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -470,7 +470,7 @@ nsLookAndFeel::GetEchoPasswordImpl()
|
|||||||
{
|
{
|
||||||
if (!mInitializedShowPassword) {
|
if (!mInitializedShowPassword) {
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||||
mShowPassword = GeckoAppShell::GetShowPasswordSetting();
|
mShowPassword = mozilla::widget::android::GeckoAppShell::GetShowPasswordSetting();
|
||||||
} else {
|
} else {
|
||||||
ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
|
ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ nsScreenAndroid::GetColorDepth(int32_t *aColorDepth)
|
|||||||
void
|
void
|
||||||
nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
|
nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
|
||||||
{
|
{
|
||||||
GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
|
mozilla::widget::android::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(nsScreenManagerAndroid, nsIScreenManager)
|
NS_IMPL_ISUPPORTS1(nsScreenManagerAndroid, nsIScreenManager)
|
||||||
|
@ -352,7 +352,7 @@ nsWindow::GetDefaultScaleInternal()
|
|||||||
return density;
|
return density;
|
||||||
}
|
}
|
||||||
|
|
||||||
density = GeckoAppShell::GetDensity();
|
density = mozilla::widget::android::GeckoAppShell::GetDensity();
|
||||||
|
|
||||||
if (!density) {
|
if (!density) {
|
||||||
density = 1.0;
|
density = 1.0;
|
||||||
@ -514,7 +514,7 @@ nsWindow::SetSizeMode(int32_t aMode)
|
|||||||
{
|
{
|
||||||
switch (aMode) {
|
switch (aMode) {
|
||||||
case nsSizeMode_Minimized:
|
case nsSizeMode_Minimized:
|
||||||
GeckoAppShell::MoveTaskToBack();
|
mozilla::widget::android::GeckoAppShell::MoveTaskToBack();
|
||||||
break;
|
break;
|
||||||
case nsSizeMode_Fullscreen:
|
case nsSizeMode_Fullscreen:
|
||||||
MakeFullScreen(true);
|
MakeFullScreen(true);
|
||||||
@ -692,7 +692,7 @@ nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsWindow::MakeFullScreen(bool aFullScreen)
|
nsWindow::MakeFullScreen(bool aFullScreen)
|
||||||
{
|
{
|
||||||
GeckoAppShell::SetFullScreen(aFullScreen);
|
mozilla::widget::android::GeckoAppShell::SetFullScreen(aFullScreen);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1193,7 +1193,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
|||||||
// if this event is a down event, that means it's the start of a new block, and the
|
// if this event is a down event, that means it's the start of a new block, and the
|
||||||
// previous block should not be default-prevented
|
// previous block should not be default-prevented
|
||||||
bool defaultPrevented = isDownEvent ? false : preventDefaultActions;
|
bool defaultPrevented = isDownEvent ? false : preventDefaultActions;
|
||||||
GeckoAppShell::NotifyDefaultPrevented(defaultPrevented);
|
mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(defaultPrevented);
|
||||||
sDefaultPreventedNotified = true;
|
sDefaultPreventedNotified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1202,7 +1202,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
|
|||||||
// for the next event.
|
// for the next event.
|
||||||
if (isDownEvent) {
|
if (isDownEvent) {
|
||||||
if (preventDefaultActions) {
|
if (preventDefaultActions) {
|
||||||
GeckoAppShell::NotifyDefaultPrevented(true);
|
mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(true);
|
||||||
sDefaultPreventedNotified = true;
|
sDefaultPreventedNotified = true;
|
||||||
} else {
|
} else {
|
||||||
sDefaultPreventedNotified = false;
|
sDefaultPreventedNotified = false;
|
||||||
@ -1838,10 +1838,10 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
|||||||
NotifyIMEOfTextChange(notification);
|
NotifyIMEOfTextChange(notification);
|
||||||
FlushIMEChanges();
|
FlushIMEChanges();
|
||||||
}
|
}
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
||||||
return;
|
return;
|
||||||
} else if (ae->Action() == AndroidGeckoEvent::IME_UPDATE_CONTEXT) {
|
} else if (ae->Action() == AndroidGeckoEvent::IME_UPDATE_CONTEXT) {
|
||||||
GeckoAppShell::NotifyIMEContext(mInputContext.mIMEState.mEnabled,
|
mozilla::widget::android::GeckoAppShell::NotifyIMEContext(mInputContext.mIMEState.mEnabled,
|
||||||
mInputContext.mHTMLInputType,
|
mInputContext.mHTMLInputType,
|
||||||
mInputContext.mHTMLInputInputmode,
|
mInputContext.mHTMLInputInputmode,
|
||||||
mInputContext.mActionHint);
|
mInputContext.mActionHint);
|
||||||
@ -1852,7 +1852,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
|||||||
// Still reply to events, but don't do anything else
|
// Still reply to events, but don't do anything else
|
||||||
if (ae->Action() == AndroidGeckoEvent::IME_SYNCHRONIZE ||
|
if (ae->Action() == AndroidGeckoEvent::IME_SYNCHRONIZE ||
|
||||||
ae->Action() == AndroidGeckoEvent::IME_REPLACE_TEXT) {
|
ae->Action() == AndroidGeckoEvent::IME_REPLACE_TEXT) {
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1865,7 +1865,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
|||||||
case AndroidGeckoEvent::IME_SYNCHRONIZE:
|
case AndroidGeckoEvent::IME_SYNCHRONIZE:
|
||||||
{
|
{
|
||||||
FlushIMEChanges();
|
FlushIMEChanges();
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AndroidGeckoEvent::IME_REPLACE_TEXT:
|
case AndroidGeckoEvent::IME_REPLACE_TEXT:
|
||||||
@ -1897,7 +1897,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
|||||||
}
|
}
|
||||||
mIMEKeyEvents.Clear();
|
mIMEKeyEvents.Clear();
|
||||||
FlushIMEChanges();
|
FlushIMEChanges();
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1925,7 +1925,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
|||||||
DispatchEvent(&event);
|
DispatchEvent(&event);
|
||||||
}
|
}
|
||||||
FlushIMEChanges();
|
FlushIMEChanges();
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AndroidGeckoEvent::IME_SET_SELECTION:
|
case AndroidGeckoEvent::IME_SET_SELECTION:
|
||||||
@ -2114,7 +2114,7 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification)
|
|||||||
case REQUEST_TO_COMMIT_COMPOSITION:
|
case REQUEST_TO_COMMIT_COMPOSITION:
|
||||||
//ALOGIME("IME: REQUEST_TO_COMMIT_COMPOSITION: s=%d", aState);
|
//ALOGIME("IME: REQUEST_TO_COMMIT_COMPOSITION: s=%d", aState);
|
||||||
RemoveIMEComposition();
|
RemoveIMEComposition();
|
||||||
GeckoAppShell::NotifyIME(REQUEST_TO_COMMIT_COMPOSITION);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(REQUEST_TO_COMMIT_COMPOSITION);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
case REQUEST_TO_CANCEL_COMPOSITION:
|
case REQUEST_TO_CANCEL_COMPOSITION:
|
||||||
ALOGIME("IME: REQUEST_TO_CANCEL_COMPOSITION");
|
ALOGIME("IME: REQUEST_TO_CANCEL_COMPOSITION");
|
||||||
@ -2138,11 +2138,11 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification)
|
|||||||
DispatchEvent(&compEvent);
|
DispatchEvent(&compEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeckoAppShell::NotifyIME(REQUEST_TO_CANCEL_COMPOSITION);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(REQUEST_TO_CANCEL_COMPOSITION);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
case NOTIFY_IME_OF_FOCUS:
|
case NOTIFY_IME_OF_FOCUS:
|
||||||
ALOGIME("IME: NOTIFY_IME_OF_FOCUS");
|
ALOGIME("IME: NOTIFY_IME_OF_FOCUS");
|
||||||
GeckoAppShell::NotifyIME(NOTIFY_IME_OF_FOCUS);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(NOTIFY_IME_OF_FOCUS);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
case NOTIFY_IME_OF_BLUR:
|
case NOTIFY_IME_OF_BLUR:
|
||||||
ALOGIME("IME: NOTIFY_IME_OF_BLUR");
|
ALOGIME("IME: NOTIFY_IME_OF_BLUR");
|
||||||
@ -2154,7 +2154,7 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification)
|
|||||||
mIMEComposing = false;
|
mIMEComposing = false;
|
||||||
mIMEComposingText.Truncate();
|
mIMEComposingText.Truncate();
|
||||||
|
|
||||||
GeckoAppShell::NotifyIME(NOTIFY_IME_OF_BLUR);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(NOTIFY_IME_OF_BLUR);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
case NOTIFY_IME_OF_SELECTION_CHANGE:
|
case NOTIFY_IME_OF_SELECTION_CHANGE:
|
||||||
if (mIMEMaskSelectionUpdate) {
|
if (mIMEMaskSelectionUpdate) {
|
||||||
@ -2216,7 +2216,7 @@ nsWindow::SetInputContext(const InputContext& aContext,
|
|||||||
|
|
||||||
if (enabled == IMEState::ENABLED && aAction.UserMightRequestOpenVKB()) {
|
if (enabled == IMEState::ENABLED && aAction.UserMightRequestOpenVKB()) {
|
||||||
// Don't reset keyboard when we should simply open the vkb
|
// Don't reset keyboard when we should simply open the vkb
|
||||||
GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_OPEN_VKB);
|
mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_OPEN_VKB);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2272,7 +2272,7 @@ nsWindow::FlushIMEChanges()
|
|||||||
if (!event.mSucceeded)
|
if (!event.mSucceeded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::NotifyIMEChange(event.mReply.mString,
|
mozilla::widget::android::GeckoAppShell::NotifyIMEChange(event.mReply.mString,
|
||||||
change.mStart,
|
change.mStart,
|
||||||
change.mOldEnd,
|
change.mOldEnd,
|
||||||
change.mNewEnd);
|
change.mNewEnd);
|
||||||
@ -2287,7 +2287,7 @@ nsWindow::FlushIMEChanges()
|
|||||||
if (!event.mSucceeded)
|
if (!event.mSucceeded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GeckoAppShell::NotifyIMEChange(EmptyString(),
|
mozilla::widget::android::GeckoAppShell::NotifyIMEChange(EmptyString(),
|
||||||
(int32_t) event.GetSelectionStart(),
|
(int32_t) event.GetSelectionStart(),
|
||||||
(int32_t) event.GetSelectionEnd(), -1);
|
(int32_t) event.GetSelectionEnd(), -1);
|
||||||
mIMESelectionChanged = false;
|
mIMESelectionChanged = false;
|
||||||
@ -2389,7 +2389,7 @@ nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect)
|
|||||||
|
|
||||||
AutoLocalJNIFrame jniFrame(env);
|
AutoLocalJNIFrame jniFrame(env);
|
||||||
|
|
||||||
GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient();
|
mozilla::widget::android::GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient();
|
||||||
if (!client || client->isNull()) {
|
if (!client || client->isNull()) {
|
||||||
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
|
||||||
return;
|
return;
|
||||||
@ -2428,7 +2428,7 @@ nsWindow::DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect)
|
|||||||
NS_ABORT_IF_FALSE(!mLayerRendererFrame.isNull(),
|
NS_ABORT_IF_FALSE(!mLayerRendererFrame.isNull(),
|
||||||
"Frame should have been created in DrawWindowUnderlay()!");
|
"Frame should have been created in DrawWindowUnderlay()!");
|
||||||
|
|
||||||
GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient();
|
mozilla::widget::android::GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient();
|
||||||
|
|
||||||
gl::GLContext* gl = static_cast<CompositorOGL*>(aManager->GetCompositor())->gl();
|
gl::GLContext* gl = static_cast<CompositorOGL*>(aManager->GetCompositor())->gl();
|
||||||
gl::ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST);
|
gl::ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST);
|
||||||
|
@ -27,9 +27,10 @@ ToastNotificationHandler::DisplayNotification(HSTRING title,
|
|||||||
{
|
{
|
||||||
mCookie = aCookie;
|
mCookie = aCookie;
|
||||||
|
|
||||||
ComPtr<IXmlDocument> toastXml = InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastImageAndText03);
|
Microsoft::WRL::ComPtr<IXmlDocument> toastXml =
|
||||||
ComPtr<IXmlNodeList> toastTextElements, toastImageElements;
|
InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastImageAndText03);
|
||||||
ComPtr<IXmlNode> titleTextNodeRoot, msgTextNodeRoot, imageNodeRoot, srcAttribute;
|
Microsoft::WRL::ComPtr<IXmlNodeList> toastTextElements, toastImageElements;
|
||||||
|
Microsoft::WRL::ComPtr<IXmlNode> titleTextNodeRoot, msgTextNodeRoot, imageNodeRoot, srcAttribute;
|
||||||
|
|
||||||
HSTRING textNodeStr, imageNodeStr, srcNodeStr;
|
HSTRING textNodeStr, imageNodeStr, srcNodeStr;
|
||||||
HSTRING_HEADER textHeader, imageHeader, srcHeader;
|
HSTRING_HEADER textHeader, imageHeader, srcHeader;
|
||||||
@ -43,7 +44,7 @@ ToastNotificationHandler::DisplayNotification(HSTRING title,
|
|||||||
AssertRetHRESULT(toastTextElements->Item(1, &msgTextNodeRoot), false);
|
AssertRetHRESULT(toastTextElements->Item(1, &msgTextNodeRoot), false);
|
||||||
AssertRetHRESULT(toastImageElements->Item(0, &imageNodeRoot), false);
|
AssertRetHRESULT(toastImageElements->Item(0, &imageNodeRoot), false);
|
||||||
|
|
||||||
ComPtr<IXmlNamedNodeMap> attributes;
|
Microsoft::WRL::ComPtr<IXmlNamedNodeMap> attributes;
|
||||||
AssertRetHRESULT(imageNodeRoot->get_Attributes(&attributes), false);
|
AssertRetHRESULT(imageNodeRoot->get_Attributes(&attributes), false);
|
||||||
AssertRetHRESULT(attributes->GetNamedItem(srcNodeStr, &srcAttribute), false);
|
AssertRetHRESULT(attributes->GetNamedItem(srcNodeStr, &srcAttribute), false);
|
||||||
|
|
||||||
@ -62,9 +63,10 @@ ToastNotificationHandler::DisplayTextNotification(HSTRING title,
|
|||||||
{
|
{
|
||||||
mCookie = aCookie;
|
mCookie = aCookie;
|
||||||
|
|
||||||
ComPtr<IXmlDocument> toastXml = InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastText03);
|
Microsoft::WRL::ComPtr<IXmlDocument> toastXml =
|
||||||
ComPtr<IXmlNodeList> toastTextElements;
|
InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastText03);
|
||||||
ComPtr<IXmlNode> titleTextNodeRoot, msgTextNodeRoot;
|
Microsoft::WRL::ComPtr<IXmlNodeList> toastTextElements;
|
||||||
|
Microsoft::WRL::ComPtr<IXmlNode> titleTextNodeRoot, msgTextNodeRoot;
|
||||||
|
|
||||||
HSTRING textNodeStr;
|
HSTRING textNodeStr;
|
||||||
HSTRING_HEADER textHeader;
|
HSTRING_HEADER textHeader;
|
||||||
@ -80,9 +82,9 @@ ToastNotificationHandler::DisplayTextNotification(HSTRING title,
|
|||||||
return CreateWindowsNotificationFromXml(toastXml.Get(), aAppId);
|
return CreateWindowsNotificationFromXml(toastXml.Get(), aAppId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComPtr<IXmlDocument>
|
Microsoft::WRL::ComPtr<IXmlDocument>
|
||||||
ToastNotificationHandler::InitializeXmlForTemplate(ToastTemplateType templateType) {
|
ToastNotificationHandler::InitializeXmlForTemplate(ToastTemplateType templateType) {
|
||||||
ComPtr<IXmlDocument> toastXml;
|
Microsoft::WRL::ComPtr<IXmlDocument> toastXml;
|
||||||
|
|
||||||
AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(),
|
AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(),
|
||||||
mToastNotificationManagerStatics.GetAddressOf()), nullptr);
|
mToastNotificationManagerStatics.GetAddressOf()), nullptr);
|
||||||
@ -96,8 +98,8 @@ bool
|
|||||||
ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXml,
|
ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXml,
|
||||||
const nsAString& aAppId)
|
const nsAString& aAppId)
|
||||||
{
|
{
|
||||||
ComPtr<IToastNotification> notification;
|
Microsoft::WRL::ComPtr<IToastNotification> notification;
|
||||||
ComPtr<IToastNotificationFactory> factory;
|
Microsoft::WRL::ComPtr<IToastNotificationFactory> factory;
|
||||||
AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(),
|
AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(),
|
||||||
factory.GetAddressOf()), false);
|
factory.GetAddressOf()), false);
|
||||||
AssertRetHRESULT(factory->CreateToastNotification(toastXml, ¬ification),
|
AssertRetHRESULT(factory->CreateToastNotification(toastXml, ¬ification),
|
||||||
@ -110,7 +112,7 @@ ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXm
|
|||||||
AssertRetHRESULT(notification->add_Dismissed(Callback<ToastDismissHandler>(this,
|
AssertRetHRESULT(notification->add_Dismissed(Callback<ToastDismissHandler>(this,
|
||||||
&ToastNotificationHandler::OnDismiss).Get(), &dismissedToken), false);
|
&ToastNotificationHandler::OnDismiss).Get(), &dismissedToken), false);
|
||||||
|
|
||||||
ComPtr<IToastNotifier> notifier;
|
Microsoft::WRL::ComPtr<IToastNotifier> notifier;
|
||||||
if (aAppId.IsEmpty()) {
|
if (aAppId.IsEmpty()) {
|
||||||
AssertRetHRESULT(mToastNotificationManagerStatics->CreateToastNotifier(
|
AssertRetHRESULT(mToastNotificationManagerStatics->CreateToastNotifier(
|
||||||
¬ifier), false);
|
¬ifier), false);
|
||||||
@ -126,9 +128,10 @@ ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXm
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToastNotificationHandler::SetNodeValueString(HSTRING inputString, ComPtr<IXmlNode> node, ComPtr<IXmlDocument> xml) {
|
void ToastNotificationHandler::SetNodeValueString(HSTRING inputString,
|
||||||
ComPtr<IXmlText> inputText;
|
Microsoft::WRL::ComPtr<IXmlNode> node, Microsoft::WRL::ComPtr<IXmlDocument> xml) {
|
||||||
ComPtr<IXmlNode> inputTextNode, pAppendedChild;
|
Microsoft::WRL::ComPtr<IXmlText> inputText;
|
||||||
|
Microsoft::WRL::ComPtr<IXmlNode> inputTextNode, pAppendedChild;
|
||||||
|
|
||||||
AssertHRESULT(xml->CreateTextNode(inputString, &inputText));
|
AssertHRESULT(xml->CreateTextNode(inputString, &inputText));
|
||||||
AssertHRESULT(inputText.As(&inputTextNode));
|
AssertHRESULT(inputText.As(&inputTextNode));
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "mozwrlbase.h"
|
#include "mozwrlbase.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
|
|
||||||
class ToastNotificationHandler {
|
class ToastNotificationHandler {
|
||||||
typedef ABI::Windows::UI::Notifications::IToastNotification IToastNotification;
|
typedef ABI::Windows::UI::Notifications::IToastNotification IToastNotification;
|
||||||
@ -20,7 +19,8 @@ class ToastNotificationHandler {
|
|||||||
typedef ABI::Windows::Data::Xml::Dom::IXmlNode IXmlNode;
|
typedef ABI::Windows::Data::Xml::Dom::IXmlNode IXmlNode;
|
||||||
typedef ABI::Windows::Data::Xml::Dom::IXmlDocument IXmlDocument;
|
typedef ABI::Windows::Data::Xml::Dom::IXmlDocument IXmlDocument;
|
||||||
|
|
||||||
void SetNodeValueString(HSTRING inputString, ComPtr<IXmlNode> node, ComPtr<IXmlDocument> xml);
|
void SetNodeValueString(HSTRING inputString,Microsoft::WRL::ComPtr<IXmlNode> node,
|
||||||
|
Microsoft::WRL::ComPtr<IXmlDocument> xml);
|
||||||
public:
|
public:
|
||||||
ToastNotificationHandler() {};
|
ToastNotificationHandler() {};
|
||||||
~ToastNotificationHandler() {};
|
~ToastNotificationHandler() {};
|
||||||
@ -36,9 +36,9 @@ class ToastNotificationHandler {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
nsString mCookie;
|
nsString mCookie;
|
||||||
ComPtr<IToastNotificationManagerStatics> mToastNotificationManagerStatics;
|
Microsoft::WRL::ComPtr<IToastNotificationManagerStatics> mToastNotificationManagerStatics;
|
||||||
|
|
||||||
bool CreateWindowsNotificationFromXml(IXmlDocument *toastXml,
|
bool CreateWindowsNotificationFromXml(IXmlDocument *toastXml,
|
||||||
const nsAString& aAppId);
|
const nsAString& aAppId);
|
||||||
ComPtr<IXmlDocument> InitializeXmlForTemplate(ToastTemplateType templateType);
|
Microsoft::WRL::ComPtr<IXmlDocument> InitializeXmlForTemplate(ToastTemplateType templateType);
|
||||||
};
|
};
|
||||||
|
@ -24,11 +24,10 @@ namespace mozilla {
|
|||||||
namespace widget {
|
namespace widget {
|
||||||
namespace winrt {
|
namespace winrt {
|
||||||
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
|
|
||||||
// represents the root window to UIA
|
// represents the root window to UIA
|
||||||
[uuid("D3EDD951-0715-4501-A8E5-25D97EF35D5A")]
|
[uuid("D3EDD951-0715-4501-A8E5-25D97EF35D5A")]
|
||||||
class UIABridge : public RuntimeClass<RuntimeClassFlags<RuntimeClassType::WinRtClassicComMix>,
|
class UIABridge : public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags
|
||||||
|
<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>,
|
||||||
IUIABridge,
|
IUIABridge,
|
||||||
IUIAElement,
|
IUIAElement,
|
||||||
IRawElementProviderSimple,
|
IRawElementProviderSimple,
|
||||||
@ -81,7 +80,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
[uuid("4438135F-F624-43DE-A417-275CE7A1A0CD")]
|
[uuid("4438135F-F624-43DE-A417-275CE7A1A0CD")]
|
||||||
class UIATextElement : public RuntimeClass<RuntimeClassFlags<RuntimeClassType::WinRtClassicComMix>,
|
class UIATextElement : public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags
|
||||||
|
<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>,
|
||||||
IUIAElement,
|
IUIAElement,
|
||||||
IRawElementProviderSimple,
|
IRawElementProviderSimple,
|
||||||
IRawElementProviderFragment,
|
IRawElementProviderFragment,
|
||||||
|
@ -267,7 +267,7 @@ nsSystemInfo::Init()
|
|||||||
android_sdk_version = version;
|
android_sdk_version = version;
|
||||||
if (version >= 8 && mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str))
|
if (version >= 8 && mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str))
|
||||||
SetPropertyAsAString(NS_LITERAL_STRING("hardware"), str);
|
SetPropertyAsAString(NS_LITERAL_STRING("hardware"), str);
|
||||||
bool isTablet = GeckoAppShell::IsTablet();
|
bool isTablet = mozilla::widget::android::GeckoAppShell::IsTablet();
|
||||||
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), isTablet);
|
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), isTablet);
|
||||||
// NSPR "version" is the kernel version. For Android we want the Android version.
|
// NSPR "version" is the kernel version. For Android we want the Android version.
|
||||||
// Rename SDK version to version and put the kernel version into kernel_version.
|
// Rename SDK version to version and put the kernel version into kernel_version.
|
||||||
|
@ -1898,7 +1898,8 @@ nsLocalFile::Launch()
|
|||||||
rv = mimeService->GetTypeFromFile(this, type);
|
rv = mimeService->GetTypeFromFile(this, type);
|
||||||
|
|
||||||
nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
|
nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
|
||||||
return GeckoAppShell::OpenUriExternal(NS_ConvertUTF8toUTF16(fileUri), NS_ConvertUTF8toUTF16(type)) ? NS_OK : NS_ERROR_FAILURE;
|
return mozilla::widget::android::GeckoAppShell::OpenUriExternal(NS_ConvertUTF8toUTF16(fileUri),
|
||||||
|
NS_ConvertUTF8toUTF16(type)) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
#elif defined(MOZ_WIDGET_COCOA)
|
#elif defined(MOZ_WIDGET_COCOA)
|
||||||
CFURLRef url;
|
CFURLRef url;
|
||||||
if (NS_SUCCEEDED(GetCFURL(&url))) {
|
if (NS_SUCCEEDED(GetCFURL(&url))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user