Bug 1287946 - Update existing code to use mozilla::java; r=me
This commit is contained in:
@@ -4,19 +4,19 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
void StartGamepadMonitoring()
|
void StartGamepadMonitoring()
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::StartMonitoringGamepad();
|
java::GeckoAppShell::StartMonitoringGamepad();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopGamepadMonitoring()
|
void StopGamepadMonitoring()
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::StopMonitoringGamepad();
|
java::GeckoAppShell::StopMonitoringGamepad();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
|
|||||||
@@ -2837,7 +2837,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 = mozilla::widget::GeckoAppShell::GetShowPasswordSetting();
|
*showPassword = java::GeckoAppShell::GetShowPasswordSetting();
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "nsIGfxInfo.h"
|
#include "nsIGfxInfo.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
#endif
|
||||||
#include "mozilla/layers/LayersTypes.h"
|
#include "mozilla/layers/LayersTypes.h"
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,6 @@
|
|||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
#include "mozilla/Snprintf.h"
|
#include "mozilla/Snprintf.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct JSContext;
|
struct JSContext;
|
||||||
class JSObject;
|
class JSObject;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ static PRLogModuleInfo* AndroidDecoderModuleLog()
|
|||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::gl;
|
using namespace mozilla::gl;
|
||||||
using namespace mozilla::widget::sdk;
|
using namespace mozilla::java::sdk;
|
||||||
using media::TimeUnit;
|
using media::TimeUnit;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
@@ -179,9 +179,9 @@ public:
|
|||||||
&buffer));
|
&buffer));
|
||||||
|
|
||||||
if (!buffer && aConfig.mCodecSpecificConfig->Length() >= 2) {
|
if (!buffer && aConfig.mCodecSpecificConfig->Length() >= 2) {
|
||||||
buffer = jni::Object::LocalRef::Adopt(
|
buffer = jni::ByteBuffer::New(
|
||||||
env, env->NewDirectByteBuffer(aConfig.mCodecSpecificConfig->Elements(),
|
aConfig.mCodecSpecificConfig->Elements(),
|
||||||
aConfig.mCodecSpecificConfig->Length()));
|
aConfig.mCodecSpecificConfig->Length());
|
||||||
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
|
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
|
||||||
buffer));
|
buffer));
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ AndroidDecoderModule::SupportsMimeType(const nsACString& aMimeType,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return widget::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
|
return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
|
||||||
nsCString(TranslateMimeType(aMimeType)));
|
nsCString(TranslateMimeType(aMimeType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
MediaCodecDataDecoder(MediaData::Type aType,
|
MediaCodecDataDecoder(MediaData::Type aType,
|
||||||
const nsACString& aMimeType,
|
const nsACString& aMimeType,
|
||||||
widget::sdk::MediaFormat::Param aFormat,
|
java::sdk::MediaFormat::Param aFormat,
|
||||||
MediaDataDecoderCallback* aCallback);
|
MediaDataDecoderCallback* aCallback);
|
||||||
|
|
||||||
virtual ~MediaCodecDataDecoder();
|
virtual ~MediaCodecDataDecoder();
|
||||||
@@ -73,16 +73,16 @@ protected:
|
|||||||
|
|
||||||
static const char* ModuleStateStr(ModuleState aState);
|
static const char* ModuleStateStr(ModuleState aState);
|
||||||
|
|
||||||
virtual nsresult InitDecoder(widget::sdk::Surface::Param aSurface);
|
virtual nsresult InitDecoder(java::sdk::Surface::Param aSurface);
|
||||||
|
|
||||||
virtual nsresult Output(widget::sdk::BufferInfo::Param aInfo, void* aBuffer,
|
virtual nsresult Output(java::sdk::BufferInfo::Param aInfo, void* aBuffer,
|
||||||
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual nsresult PostOutput(widget::sdk::BufferInfo::Param aInfo,
|
virtual nsresult PostOutput(java::sdk::BufferInfo::Param aInfo,
|
||||||
widget::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -99,8 +99,8 @@ protected:
|
|||||||
nsresult QueueEOS();
|
nsresult QueueEOS();
|
||||||
void HandleEOS(int32_t aOutputStatus);
|
void HandleEOS(int32_t aOutputStatus);
|
||||||
Maybe<media::TimeUnit> GetOutputDuration();
|
Maybe<media::TimeUnit> GetOutputDuration();
|
||||||
nsresult ProcessOutput(widget::sdk::BufferInfo::Param aInfo,
|
nsresult ProcessOutput(java::sdk::BufferInfo::Param aInfo,
|
||||||
widget::sdk::MediaFormat::Param aFormat,
|
java::sdk::MediaFormat::Param aFormat,
|
||||||
int32_t aStatus);
|
int32_t aStatus);
|
||||||
ModuleState State() const;
|
ModuleState State() const;
|
||||||
// Sets decoder state and returns whether the new state has become effective.
|
// Sets decoder state and returns whether the new state has become effective.
|
||||||
@@ -112,11 +112,11 @@ protected:
|
|||||||
MediaData::Type mType;
|
MediaData::Type mType;
|
||||||
|
|
||||||
nsAutoCString mMimeType;
|
nsAutoCString mMimeType;
|
||||||
widget::sdk::MediaFormat::GlobalRef mFormat;
|
java::sdk::MediaFormat::GlobalRef mFormat;
|
||||||
|
|
||||||
MediaDataDecoderCallback* mCallback;
|
MediaDataDecoderCallback* mCallback;
|
||||||
|
|
||||||
widget::sdk::MediaCodec::GlobalRef mDecoder;
|
java::sdk::MediaCodec::GlobalRef mDecoder;
|
||||||
|
|
||||||
jni::ObjectArray::GlobalRef mInputBuffers;
|
jni::ObjectArray::GlobalRef mInputBuffers;
|
||||||
jni::ObjectArray::GlobalRef mOutputBuffers;
|
jni::ObjectArray::GlobalRef mOutputBuffers;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsISupportsUtils.h"
|
#include "nsISupportsUtils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class SmsManager : public widget::GeckoSmsManager::Natives<SmsManager>
|
class SmsManager : public java::GeckoSmsManager::Natives<SmsManager>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SmsManager();
|
SmsManager();
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsNPAPIPluginInstance.h"
|
#include "nsNPAPIPluginInstance.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsNPAPIPlugin.h"
|
#include "nsNPAPIPlugin.h"
|
||||||
|
|
||||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
// must include config.h first for webkit to fiddle with new/delete
|
// must include config.h first for webkit to fiddle with new/delete
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "ANPBase.h"
|
#include "ANPBase.h"
|
||||||
#include "nsIPluginInstanceOwner.h"
|
#include "nsIPluginInstanceOwner.h"
|
||||||
#include "nsPluginInstanceOwner.h"
|
#include "nsPluginInstanceOwner.h"
|
||||||
|
|||||||
@@ -5,13 +5,14 @@
|
|||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
|
|
||||||
#include "assert.h"
|
|
||||||
#include "ANPBase.h"
|
#include "ANPBase.h"
|
||||||
#include <android/log.h>
|
#include "GeneratedJNIWrappers.h"
|
||||||
#include "nsNPAPIPluginInstance.h"
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsNPAPIPlugin.h"
|
|
||||||
#include "PluginPRLibrary.h"
|
#include "PluginPRLibrary.h"
|
||||||
|
#include "assert.h"
|
||||||
|
#include "nsNPAPIPluginInstance.h"
|
||||||
|
#include "nsNPAPIPlugin.h"
|
||||||
|
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
||||||
#define ASSIGN(obj, name) (obj)->name = anp_system_##name
|
#define ASSIGN(obj, name) (obj)->name = anp_system_##name
|
||||||
@@ -60,7 +61,7 @@ jclass anp_system_loadJavaClass(NPP instance, const char* className)
|
|||||||
nsCString libName;
|
nsCString libName;
|
||||||
lib->GetLibraryPath(libName);
|
lib->GetLibraryPath(libName);
|
||||||
|
|
||||||
return mozilla::widget::GeckoAppShell::LoadPluginClass(className, libName).Forget();
|
return mozilla::java::GeckoAppShell::LoadPluginClass(className, libName).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "ANPBase.h"
|
#include "ANPBase.h"
|
||||||
#include "nsIPluginInstanceOwner.h"
|
#include "nsIPluginInstanceOwner.h"
|
||||||
#include "nsPluginInstanceOwner.h"
|
#include "nsPluginInstanceOwner.h"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "ANPBase.h"
|
#include "ANPBase.h"
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsNPAPIPluginInstance.h"
|
#include "nsNPAPIPluginInstance.h"
|
||||||
#include "nsPluginInstanceOwner.h"
|
#include "nsPluginInstanceOwner.h"
|
||||||
#include "nsWindow.h"
|
#include "nsWindow.h"
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ using mozilla::plugins::PluginModuleContentParent;
|
|||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include "android_npapi.h"
|
#include "android_npapi.h"
|
||||||
#include "ANPBase.h"
|
#include "ANPBase.h"
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#undef LOG
|
#undef LOG
|
||||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
|
||||||
#endif
|
#endif
|
||||||
@@ -2115,7 +2115,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||||||
|
|
||||||
case kJavaContext_ANPGetValue: {
|
case kJavaContext_ANPGetValue: {
|
||||||
LOG("get java context");
|
LOG("get java context");
|
||||||
auto ret = widget::GeckoAppShell::GetContext();
|
auto ret = java::GeckoAppShell::GetContext();
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
|
|
||||||
|
|||||||
@@ -788,7 +788,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) {
|
||||||
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,11 +845,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) {
|
||||||
widget::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
|
java::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
|
||||||
widget::GeckoAppShell::UnlockScreenOrientation();
|
java::GeckoAppShell::UnlockScreenOrientation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1559,7 +1559,7 @@ void nsPluginInstanceOwner::RemovePluginView()
|
|||||||
if (!mInstance || !mJavaView)
|
if (!mInstance || !mJavaView)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widget::GeckoAppShell::RemovePluginView(
|
java::GeckoAppShell::RemovePluginView(
|
||||||
jni::Object::Ref::From(jobject(mJavaView)), mFullScreen);
|
jni::Object::Ref::From(jobject(mJavaView)), mFullScreen);
|
||||||
jni::GetGeckoThreadEnv()->DeleteGlobalRef((jobject)mJavaView);
|
jni::GetGeckoThreadEnv()->DeleteGlobalRef((jobject)mJavaView);
|
||||||
mJavaView = nullptr;
|
mJavaView = nullptr;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#include "nsGeolocation.h"
|
#include "nsGeolocation.h"
|
||||||
#include "nsGeoPosition.h"
|
#include "nsGeoPosition.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "AndroidLocationProvider.h"
|
#include "AndroidLocationProvider.h"
|
||||||
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ AndroidLocationProvider::~AndroidLocationProvider()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::Startup()
|
AndroidLocationProvider::Startup()
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::EnableLocation(true);
|
java::GeckoAppShell::EnableLocation(true);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,13 +43,13 @@ AndroidLocationProvider::Watch(nsIGeolocationUpdate* aCallback)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::Shutdown()
|
AndroidLocationProvider::Shutdown()
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::EnableLocation(false);
|
java::GeckoAppShell::EnableLocation(false);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
AndroidLocationProvider::SetHighAccuracy(bool enable)
|
AndroidLocationProvider::SetHighAccuracy(bool enable)
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::EnableLocationHighAccuracy(enable);
|
java::GeckoAppShell::EnableLocationHighAccuracy(enable);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "mozilla/dom/ContentChild.h"
|
#include "mozilla/dom/ContentChild.h"
|
||||||
#include "nsHapticFeedback.h"
|
#include "nsHapticFeedback.h"
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@@ -15,6 +15,6 @@ NS_IMPL_ISUPPORTS(nsHapticFeedback, nsIHapticFeedback)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHapticFeedback::PerformSimpleAction(int32_t aType)
|
nsHapticFeedback::PerformSimpleAction(int32_t aType)
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
|
java::GeckoAppShell::PerformHapticFeedback(aType == LongPress);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::jni;
|
using namespace mozilla::jni;
|
||||||
using namespace mozilla::widget;
|
using namespace mozilla::java;
|
||||||
using namespace mozilla::widget::sdk;
|
using namespace mozilla::java::sdk;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace gl {
|
namespace gl {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
void NotifyFrameAvailable();
|
void NotifyFrameAvailable();
|
||||||
|
|
||||||
GLuint Texture() const { return mTexture; }
|
GLuint Texture() const { return mTexture; }
|
||||||
const widget::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
|
const java::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AndroidSurfaceTexture();
|
AndroidSurfaceTexture();
|
||||||
@@ -92,8 +92,8 @@ private:
|
|||||||
bool Init(GLContext* aContext, GLuint aTexture);
|
bool Init(GLContext* aContext, GLuint aTexture);
|
||||||
|
|
||||||
GLuint mTexture;
|
GLuint mTexture;
|
||||||
widget::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
|
java::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
|
||||||
widget::sdk::Surface::GlobalRef mSurface;
|
java::sdk::Surface::GlobalRef mSurface;
|
||||||
|
|
||||||
GLContext* mAttachedContext;
|
GLContext* mAttachedContext;
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,10 @@ namespace mozilla {
|
|||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
AndroidSpecificState::AndroidSpecificState() {
|
AndroidSpecificState::AndroidSpecificState() {
|
||||||
widget::sdk::ViewConfiguration::LocalRef config;
|
using namespace mozilla::java;
|
||||||
if (widget::sdk::ViewConfiguration::Get(widget::GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
|
|
||||||
|
sdk::ViewConfiguration::LocalRef config;
|
||||||
|
if (sdk::ViewConfiguration::Get(GeckoAppShell::GetApplicationContext(), &config) == NS_OK) {
|
||||||
int32_t speed = 0;
|
int32_t speed = 0;
|
||||||
if (config->GetScaledMaximumFlingVelocity(&speed) == NS_OK) {
|
if (config->GetScaledMaximumFlingVelocity(&speed) == NS_OK) {
|
||||||
sMaxFlingSpeed = (float)speed * 0.001f;
|
sMaxFlingSpeed = (float)speed * 0.001f;
|
||||||
@@ -32,8 +34,9 @@ AndroidSpecificState::AndroidSpecificState() {
|
|||||||
} else {
|
} else {
|
||||||
ANDROID_APZ_LOG("%p Failed to get ViewConfiguration\n", this);
|
ANDROID_APZ_LOG("%p Failed to get ViewConfiguration\n", this);
|
||||||
}
|
}
|
||||||
widget::StackScroller::LocalRef scroller;
|
|
||||||
if (widget::StackScroller::New(widget::GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
|
StackScroller::LocalRef scroller;
|
||||||
|
if (StackScroller::New(GeckoAppShell::GetApplicationContext(), &scroller) != NS_OK) {
|
||||||
ANDROID_APZ_LOG("%p Failed to create Android StackScroller\n", this);
|
ANDROID_APZ_LOG("%p Failed to create Android StackScroller\n", this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::StackScroller::GlobalRef mOverScroller;
|
java::StackScroller::GlobalRef mOverScroller;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AndroidFlingAnimation: public AsyncPanZoomAnimation {
|
class AndroidFlingAnimation: public AsyncPanZoomAnimation {
|
||||||
@@ -40,7 +40,7 @@ private:
|
|||||||
bool CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped);
|
bool CheckBounds(Axis& aAxis, float aValue, float aDirection, float* aClamped);
|
||||||
|
|
||||||
AsyncPanZoomController& mApzc;
|
AsyncPanZoomController& mApzc;
|
||||||
widget::StackScroller::GlobalRef mOverScroller;
|
java::StackScroller::GlobalRef mOverScroller;
|
||||||
RefPtr<const OverscrollHandoffChain> mOverscrollHandoffChain;
|
RefPtr<const OverscrollHandoffChain> mOverscrollHandoffChain;
|
||||||
RefPtr<const AsyncPanZoomController> mScrolledApzc;
|
RefPtr<const AsyncPanZoomController> mScrolledApzc;
|
||||||
bool mSentBounceX;
|
bool mSentBounceX;
|
||||||
|
|||||||
@@ -89,10 +89,6 @@
|
|||||||
#include "nsScreenManagerGonk.h"
|
#include "nsScreenManagerGonk.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_ANDROID_APZ
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "LayerScope.h"
|
#include "LayerScope.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|||||||
@@ -25,10 +25,6 @@
|
|||||||
#include "cairo.h"
|
#include "cairo.h"
|
||||||
#include "VsyncSource.h"
|
#include "VsyncSource.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GONK
|
#ifdef MOZ_WIDGET_GONK
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
#include "mozilla/layers/CompositorBridgeParent.h"
|
#include "mozilla/layers/CompositorBridgeParent.h"
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "Hal.h"
|
#include "Hal.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
|
|
||||||
#include "GeneratedJNINatives.h"
|
#include "GeneratedJNINatives.h"
|
||||||
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla::hal;
|
using namespace mozilla::hal;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class AlarmReceiver : public widget::AlarmReceiver::Natives<AlarmReceiver>
|
class AlarmReceiver : public java::AlarmReceiver::Natives<AlarmReceiver>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
AlarmReceiver();
|
AlarmReceiver();
|
||||||
@@ -38,13 +38,13 @@ EnableAlarm()
|
|||||||
void
|
void
|
||||||
DisableAlarm()
|
DisableAlarm()
|
||||||
{
|
{
|
||||||
widget::GeckoAppShell::DisableAlarm();
|
java::GeckoAppShell::DisableAlarm();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SetAlarm(int32_t aSeconds, int32_t aNanoseconds)
|
SetAlarm(int32_t aSeconds, int32_t aNanoseconds)
|
||||||
{
|
{
|
||||||
return widget::GeckoAppShell::SetAlarm(aSeconds, aNanoseconds);
|
return java::GeckoAppShell::SetAlarm(aSeconds, aNanoseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // hal_impl
|
} // hal_impl
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::hal;
|
using namespace mozilla::hal;
|
||||||
|
|
||||||
|
namespace java = mozilla::java;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace hal_impl {
|
namespace hal_impl {
|
||||||
|
|
||||||
@@ -54,19 +56,19 @@ CancelVibrate(const WindowIdentifier &)
|
|||||||
{
|
{
|
||||||
// Ignore WindowIdentifier parameter.
|
// Ignore WindowIdentifier parameter.
|
||||||
|
|
||||||
mozilla::widget::GeckoAppShell::CancelVibrate();
|
java::GeckoAppShell::CancelVibrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EnableBatteryNotifications()
|
EnableBatteryNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::EnableBatteryNotifications();
|
java::GeckoAppShell::EnableBatteryNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableBatteryNotifications()
|
DisableBatteryNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::DisableBatteryNotifications();
|
java::GeckoAppShell::DisableBatteryNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -78,13 +80,13 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
|
|||||||
void
|
void
|
||||||
EnableNetworkNotifications()
|
EnableNetworkNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::EnableNetworkNotifications();
|
java::GeckoAppShell::EnableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableNetworkNotifications()
|
DisableNetworkNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::DisableNetworkNotifications();
|
java::GeckoAppShell::DisableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -96,13 +98,13 @@ GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo)
|
|||||||
void
|
void
|
||||||
EnableScreenConfigurationNotifications()
|
EnableScreenConfigurationNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::EnableScreenOrientationNotifications();
|
java::GeckoAppShell::EnableScreenOrientationNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableScreenConfigurationNotifications()
|
DisableScreenConfigurationNotifications()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::DisableScreenOrientationNotifications();
|
java::GeckoAppShell::DisableScreenOrientationNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -155,7 +157,7 @@ LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
|
|||||||
case eScreenOrientation_LandscapeSecondary:
|
case eScreenOrientation_LandscapeSecondary:
|
||||||
case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
|
case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
|
||||||
case eScreenOrientation_Default:
|
case eScreenOrientation_Default:
|
||||||
mozilla::widget::GeckoAppShell::LockScreenOrientation(orientation);
|
java::GeckoAppShell::LockScreenOrientation(orientation);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -165,7 +167,7 @@ LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
|
|||||||
void
|
void
|
||||||
UnlockScreenOrientation()
|
UnlockScreenOrientation()
|
||||||
{
|
{
|
||||||
mozilla::widget::GeckoAppShell::UnlockScreenOrientation();
|
java::GeckoAppShell::UnlockScreenOrientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // hal_impl
|
} // hal_impl
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "Hal.h"
|
#include "Hal.h"
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla::hal;
|
using namespace mozilla::hal;
|
||||||
|
|
||||||
@@ -13,12 +13,12 @@ namespace hal_impl {
|
|||||||
|
|
||||||
void
|
void
|
||||||
EnableSensorNotifications(SensorType aSensor) {
|
EnableSensorNotifications(SensorType aSensor) {
|
||||||
widget::GeckoAppShell::EnableSensor(aSensor);
|
java::GeckoAppShell::EnableSensor(aSensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DisableSensorNotifications(SensorType aSensor) {
|
DisableSensorNotifications(SensorType aSensor) {
|
||||||
widget::GeckoAppShell::DisableSensor(aSensor);
|
java::GeckoAppShell::DisableSensor(aSensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // hal_impl
|
} // hal_impl
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <webrtc/common_video/libyuv/include/webrtc_libyuv.h>
|
#include <webrtc/common_video/libyuv/include/webrtc_libyuv.h>
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::widget::sdk;
|
using namespace mozilla::java::sdk;
|
||||||
|
|
||||||
static const int32_t DECODER_TIMEOUT = 10 * PR_USEC_PER_MSEC; // 10ms
|
static const int32_t DECODER_TIMEOUT = 10 * PR_USEC_PER_MSEC; // 10ms
|
||||||
static const char MEDIACODEC_VIDEO_MIME_VP8[] = "video/x-vnd.on2.vp8";
|
static const char MEDIACODEC_VIDEO_MIME_VP8[] = "video/x-vnd.on2.vp8";
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsAndroidHistory.h"
|
#include "nsAndroidHistory.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "Link.h"
|
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
#include "Link.h"
|
||||||
|
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
@@ -77,7 +77,7 @@ nsAndroidHistory::RegisterVisitedCallback(nsIURI *aURI, Link *aContent)
|
|||||||
list->AppendElement(aContent);
|
list->AppendElement(aContent);
|
||||||
|
|
||||||
if (jni::IsAvailable()) {
|
if (jni::IsAvailable()) {
|
||||||
widget::GeckoAppShell::CheckURIVisited(uriString);
|
java::GeckoAppShell::CheckURIVisited(uriString);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -203,7 +203,7 @@ nsAndroidHistory::SaveVisitURI(nsIURI* aURI) {
|
|||||||
// Save this URI in our history
|
// Save this URI in our history
|
||||||
nsAutoCString spec;
|
nsAutoCString spec;
|
||||||
(void)aURI->GetSpec(spec);
|
(void)aURI->GetSpec(spec);
|
||||||
widget::GeckoAppShell::MarkURIVisited(NS_ConvertUTF8toUTF16(spec));
|
java::GeckoAppShell::MarkURIVisited(NS_ConvertUTF8toUTF16(spec));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, notify that we've been visited.
|
// Finally, notify that we've been visited.
|
||||||
@@ -292,7 +292,7 @@ nsAndroidHistory::SetURITitle(nsIURI *aURI, const nsAString& aTitle)
|
|||||||
SaveVisitURI(aURI);
|
SaveVisitURI(aURI);
|
||||||
}
|
}
|
||||||
NS_ConvertUTF8toUTF16 uriString(uri);
|
NS_ConvertUTF8toUTF16 uriString(uri);
|
||||||
widget::GeckoAppShell::SetURITitle(uriString, aTitle);
|
java::GeckoAppShell::SetURITitle(uriString, aTitle);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "nsShellService.h"
|
#include "nsShellService.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@@ -25,6 +25,6 @@ nsShellService::CreateShortcut(const nsAString& aTitle, const nsAString& aURI,
|
|||||||
if (!aTitle.Length() || !aURI.Length())
|
if (!aTitle.Length() || !aURI.Length())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
widget::GeckoAppShell::CreateShortcut(aTitle, aURI);
|
java::GeckoAppShell::CreateShortcut(aTitle, aURI);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Tickler::Init()
|
|||||||
MOZ_ASSERT(!mFD);
|
MOZ_ASSERT(!mFD);
|
||||||
|
|
||||||
if (jni::IsAvailable()) {
|
if (jni::IsAvailable()) {
|
||||||
widget::GeckoAppShell::EnableNetworkNotifications();
|
java::GeckoAppShell::EnableNetworkNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
mFD = PR_OpenUDPSocket(PR_AF_INET);
|
mFD = PR_OpenUDPSocket(PR_AF_INET);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "AndroidCaptureProvider.h"
|
#include "AndroidCaptureProvider.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsStreamUtils.h"
|
#include "nsStreamUtils.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsMemory.h"
|
#include "nsMemory.h"
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CameraStreamImpl::Close() {
|
void CameraStreamImpl::Close() {
|
||||||
mozilla::widget::GeckoAppShell::CloseCamera();
|
java::GeckoAppShell::CloseCamera();
|
||||||
mCallback = nullptr;
|
mCallback = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "AndroidBridge.h"
|
#include "AndroidBridge.h"
|
||||||
|
|
||||||
|
namespace java = mozilla::java;
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsAndroidNetworkLinkService,
|
NS_IMPL_ISUPPORTS(nsAndroidNetworkLinkService,
|
||||||
nsINetworkLinkService)
|
nsINetworkLinkService)
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aIsUp = mozilla::widget::GeckoAppShell::IsNetworkLinkUp();
|
*aIsUp = java::GeckoAppShell::IsNetworkLinkUp();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,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 = mozilla::widget::GeckoAppShell::IsNetworkLinkKnown();
|
*aIsKnown = java::GeckoAppShell::IsNetworkLinkKnown();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +58,6 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aLinkType = mozilla::widget::GeckoAppShell::NetworkLinkType();
|
*aLinkType = java::GeckoAppShell::NetworkLinkType();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
widget::GeckoAppShell::CloseNotification(aAlertName);
|
java::GeckoAppShell::CloseNotification(aAlertName);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -354,9 +354,8 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,
|
|||||||
const nsAString & aAlertText)
|
const nsAString & aAlertText)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
widget::GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName,
|
java::GeckoAppShell::AlertsProgressListener_OnProgress(
|
||||||
aProgress, aProgressMax,
|
aAlertName, aProgress, aProgressMax, aAlertText);
|
||||||
aAlertText);
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
@@ -366,7 +365,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
|
||||||
widget::GeckoAppShell::CloseNotification(aAlertName);
|
java::GeckoAppShell::CloseNotification(aAlertName);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
@@ -2791,7 +2791,7 @@ nsDownload::SetState(DownloadState aState)
|
|||||||
if (mimeInfo)
|
if (mimeInfo)
|
||||||
mimeInfo->GetMIMEType(contentType);
|
mimeInfo->GetMIMEType(contentType);
|
||||||
|
|
||||||
mozilla::widget::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
|
java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (addToRecentDocs && !mPrivate) {
|
if (addToRecentDocs && !mPrivate) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#ifdef MOZ_WIDGET_GTK
|
||||||
@@ -84,7 +84,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIFile* aTarget,
|
|||||||
bool addToRecentDocs = Preferences::GetBool(PREF_BDM_ADDTORECENTDOCS);
|
bool addToRecentDocs = Preferences::GetBool(PREF_BDM_ADDTORECENTDOCS);
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
if (addToRecentDocs) {
|
if (addToRecentDocs) {
|
||||||
mozilla::widget::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(aContentType));
|
java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(aContentType));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (addToRecentDocs && !aIsPrivate) {
|
if (addToRecentDocs && !aIsPrivate) {
|
||||||
|
|||||||
@@ -4,9 +4,11 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "nsParentalControlsService.h"
|
#include "nsParentalControlsService.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
|
namespace java = mozilla::java;
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
|
NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
|
||||||
|
|
||||||
@@ -14,7 +16,7 @@ nsParentalControlsService::nsParentalControlsService() :
|
|||||||
mEnabled(false)
|
mEnabled(false)
|
||||||
{
|
{
|
||||||
if (mozilla::jni::IsAvailable()) {
|
if (mozilla::jni::IsAvailable()) {
|
||||||
mEnabled = mozilla::widget::Restrictions::IsUserRestricted();
|
mEnabled = java::Restrictions::IsUserRestricted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +94,7 @@ nsParentalControlsService::IsAllowed(int16_t aAction,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
*_retval = mozilla::widget::Restrictions::IsAllowed(aAction,
|
*_retval = java::Restrictions::IsAllowed(aAction,
|
||||||
NS_ConvertUTF8toUTF16(url));
|
NS_ConvertUTF8toUTF16(url));
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,7 +199,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MOZ_SANDBOX)
|
#if defined(MOZ_SANDBOX)
|
||||||
@@ -1720,7 +1720,7 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative,
|
|||||||
SaveToEnv("MOZ_LAUNCHED_CHILD=1");
|
SaveToEnv("MOZ_LAUNCHED_CHILD=1");
|
||||||
|
|
||||||
#if defined(MOZ_WIDGET_ANDROID)
|
#if defined(MOZ_WIDGET_ANDROID)
|
||||||
mozilla::widget::GeckoAppShell::ScheduleRestart();
|
java::GeckoAppShell::ScheduleRestart();
|
||||||
#else
|
#else
|
||||||
#if defined(XP_MACOSX)
|
#if defined(XP_MACOSX)
|
||||||
CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv, true);
|
CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv, true);
|
||||||
@@ -1858,7 +1858,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
|
|||||||
if (aUnlocker) {
|
if (aUnlocker) {
|
||||||
int32_t button;
|
int32_t button;
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
mozilla::widget::GeckoAppShell::KillAnyZombies();
|
java::GeckoAppShell::KillAnyZombies();
|
||||||
button = 0;
|
button = 0;
|
||||||
#else
|
#else
|
||||||
const uint32_t flags =
|
const uint32_t flags =
|
||||||
@@ -1887,7 +1887,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
if (mozilla::widget::GeckoAppShell::UnlockProfile()) {
|
if (java::GeckoAppShell::UnlockProfile()) {
|
||||||
return NS_LockProfilePath(aProfileDir, aProfileLocalDir,
|
return NS_LockProfilePath(aProfileDir, aProfileLocalDir,
|
||||||
nullptr, aResult);
|
nullptr, aResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter)
|
|||||||
firstRun = false;
|
firstRun = false;
|
||||||
|
|
||||||
double sampleTime =
|
double sampleTime =
|
||||||
mozilla::widget::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
|
java::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId);
|
||||||
|
|
||||||
aWriter.StartObjectElement();
|
aWriter.StartObjectElement();
|
||||||
aWriter.DoubleProperty("time", sampleTime);
|
aWriter.DoubleProperty("time", sampleTime);
|
||||||
@@ -562,7 +562,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
|
|||||||
|
|
||||||
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
||||||
if (ProfileJava()) {
|
if (ProfileJava()) {
|
||||||
mozilla::widget::GeckoJavaSampler::PauseJavaProfiling();
|
java::GeckoJavaSampler::PauseJavaProfiling();
|
||||||
|
|
||||||
aWriter.Start();
|
aWriter.Start();
|
||||||
{
|
{
|
||||||
@@ -570,7 +570,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
|
|||||||
}
|
}
|
||||||
aWriter.End();
|
aWriter.End();
|
||||||
|
|
||||||
mozilla::widget::GeckoJavaSampler::UnpauseJavaProfiling();
|
java::GeckoJavaSampler::UnpauseJavaProfiling();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
|
||||||
class GeckoJavaSampler : public widget::GeckoJavaSampler::Natives<GeckoJavaSampler>
|
class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
GeckoJavaSampler();
|
GeckoJavaSampler();
|
||||||
@@ -825,7 +825,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
|
|||||||
if (javaInterval < 10) {
|
if (javaInterval < 10) {
|
||||||
aInterval = 10;
|
aInterval = 10;
|
||||||
}
|
}
|
||||||
mozilla::widget::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
|
java::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "nsAndroidHandlerApp.h"
|
#include "nsAndroidHandlerApp.h"
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC
|
|||||||
{
|
{
|
||||||
nsCString uriSpec;
|
nsCString uriSpec;
|
||||||
aURI->GetSpec(uriSpec);
|
aURI->GetSpec(uriSpec);
|
||||||
return widget::GeckoAppShell::OpenUriExternal(
|
return java::GeckoAppShell::OpenUriExternal(
|
||||||
uriSpec, mMimeType, mPackageName, mClassName,
|
uriSpec, mMimeType, mPackageName, mClassName,
|
||||||
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
|
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
|
nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
|
||||||
{
|
{
|
||||||
return widget::GeckoAppShell::OpenUriExternal(
|
return java::GeckoAppShell::OpenUriExternal(
|
||||||
data, mMimeType, mPackageName, mClassName,
|
data, mMimeType, mPackageName, mClassName,
|
||||||
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
|
mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ 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 widget::GeckoAppShell::OpenUriExternal(data,
|
return java::GeckoAppShell::OpenUriExternal(data,
|
||||||
mime, emptyString, emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
|
mime, emptyString, emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI)
|
|||||||
mimeType = NS_ConvertUTF8toUTF16(mType);
|
mimeType = NS_ConvertUTF8toUTF16(mType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget::GeckoAppShell::OpenUriExternal(
|
if (java::GeckoAppShell::OpenUriExternal(
|
||||||
NS_ConvertUTF8toUTF16(uriSpec), mimeType, EmptyString(),
|
NS_ConvertUTF8toUTF16(uriSpec), mimeType, EmptyString(),
|
||||||
EmptyString(), EmptyString(), EmptyString())) {
|
EmptyString(), EmptyString(), EmptyString())) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
@@ -382,7 +382,7 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
|
|||||||
// In the case where we do not have the permission we will start the
|
// In the case where we do not have the permission we will start the
|
||||||
// download to the app cache directory and later move it to the final
|
// download to the app cache directory and later move it to the final
|
||||||
// destination after prompting for the permission.
|
// destination after prompting for the permission.
|
||||||
auto downloadDir = widget::DownloadsIntegration::GetTemporaryDownloadDirectory();
|
auto downloadDir = java::DownloadsIntegration::GetTemporaryDownloadDirectory();
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
if (downloadDir) {
|
if (downloadDir) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class ANRReporter : public widget::ANRReporter::Natives<ANRReporter>
|
class ANRReporter : public java::ANRReporter::Natives<ANRReporter>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ANRReporter();
|
ANRReporter();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::gfx;
|
using namespace mozilla::gfx;
|
||||||
using namespace mozilla::jni;
|
using namespace mozilla::jni;
|
||||||
using namespace mozilla::widget;
|
using namespace mozilla::java;
|
||||||
|
|
||||||
AndroidBridge* AndroidBridge::sBridge = nullptr;
|
AndroidBridge* AndroidBridge::sBridge = nullptr;
|
||||||
pthread_t AndroidBridge::sJavaUiThread;
|
pthread_t AndroidBridge::sJavaUiThread;
|
||||||
@@ -199,12 +199,12 @@ AndroidBridge::AndroidBridge()
|
|||||||
JNIEnv* const jEnv = jni::GetGeckoThreadEnv();
|
JNIEnv* const jEnv = jni::GetGeckoThreadEnv();
|
||||||
AutoLocalJNIFrame jniFrame(jEnv);
|
AutoLocalJNIFrame jniFrame(jEnv);
|
||||||
|
|
||||||
mClassLoader = Object::GlobalRef(jEnv, widget::GeckoThread::ClsLoader());
|
mClassLoader = Object::GlobalRef(jEnv, java::GeckoThread::ClsLoader());
|
||||||
mClassLoaderLoadClass = GetMethodID(
|
mClassLoaderLoadClass = GetMethodID(
|
||||||
jEnv, jEnv->GetObjectClass(mClassLoader.Get()),
|
jEnv, jEnv->GetObjectClass(mClassLoader.Get()),
|
||||||
"loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
|
"loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
|
||||||
|
|
||||||
mMessageQueue = widget::GeckoThread::MsgQueue();
|
mMessageQueue = java::GeckoThread::MsgQueue();
|
||||||
auto msgQueueClass = Class::LocalRef::Adopt(
|
auto msgQueueClass = Class::LocalRef::Adopt(
|
||||||
jEnv, jEnv->GetObjectClass(mMessageQueue.Get()));
|
jEnv, jEnv->GetObjectClass(mMessageQueue.Get()));
|
||||||
// mMessageQueueNext must not be null
|
// mMessageQueueNext must not be null
|
||||||
@@ -925,7 +925,7 @@ AndroidBridge::HandleGeckoMessage(JSContext* cx, JS::HandleObject object)
|
|||||||
{
|
{
|
||||||
ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
|
ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
auto message = mozilla::widget::CreateNativeJSContainer(cx, object);
|
auto message = widget::CreateNativeJSContainer(cx, object);
|
||||||
GeckoAppShell::HandleGeckoMessageWrapper(message);
|
GeckoAppShell::HandleGeckoMessageWrapper(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,8 +155,8 @@ public:
|
|||||||
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical,
|
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const LayerRect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical,
|
||||||
mozilla::ParentLayerPoint& aScrollOffset, mozilla::CSSToParentLayerScale& aZoom);
|
mozilla::ParentLayerPoint& aScrollOffset, mozilla::CSSToParentLayerScale& aZoom);
|
||||||
|
|
||||||
void SetLayerClient(widget::GeckoLayerClient::Param jobj);
|
void SetLayerClient(java::GeckoLayerClient::Param jobj);
|
||||||
const widget::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
|
const java::GeckoLayerClient::Ref& GetLayerClient() { return mLayerClient; }
|
||||||
|
|
||||||
bool GetHandlersForURL(const nsAString& aURL,
|
bool GetHandlersForURL(const nsAString& aURL,
|
||||||
nsIMutableArray* handlersArray = nullptr,
|
nsIMutableArray* handlersArray = nullptr,
|
||||||
@@ -341,7 +341,7 @@ protected:
|
|||||||
nsTArray<nsCOMPtr<nsIMobileMessageCallback>> mSmsRequests;
|
nsTArray<nsCOMPtr<nsIMobileMessageCallback>> mSmsRequests;
|
||||||
nsTArray<nsCOMPtr<nsIMobileMessageCursorCallback>> mSmsCursorRequests;
|
nsTArray<nsCOMPtr<nsIMobileMessageCursorCallback>> mSmsCursorRequests;
|
||||||
|
|
||||||
widget::GeckoLayerClient::GlobalRef mLayerClient;
|
java::GeckoLayerClient::GlobalRef mLayerClient;
|
||||||
|
|
||||||
// the android.telephony.SmsMessage class
|
// the android.telephony.SmsMessage class
|
||||||
jclass mAndroidSmsMessageClass;
|
jclass mAndroidSmsMessageClass;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class GeckoNetworkManager final
|
class GeckoNetworkManager final
|
||||||
: public widget::GeckoNetworkManager::Natives<GeckoNetworkManager>
|
: public java::GeckoNetworkManager::Natives<GeckoNetworkManager>
|
||||||
, public UsesGeckoThreadProxy
|
, public UsesGeckoThreadProxy
|
||||||
{
|
{
|
||||||
GeckoNetworkManager() = delete;
|
GeckoNetworkManager() = delete;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class GeckoScreenOrientation final
|
class GeckoScreenOrientation final
|
||||||
: public widget::GeckoScreenOrientation::Natives<GeckoScreenOrientation>
|
: public java::GeckoScreenOrientation::Natives<GeckoScreenOrientation>
|
||||||
, public UsesGeckoThreadProxy
|
, public UsesGeckoThreadProxy
|
||||||
{
|
{
|
||||||
GeckoScreenOrientation() = delete;
|
GeckoScreenOrientation() = delete;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "mozilla/jni/Natives.h"
|
#include "mozilla/jni/Natives.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace widget {
|
namespace java {
|
||||||
|
|
||||||
template<class Impl>
|
template<class Impl>
|
||||||
class ANRReporter::Natives : public mozilla::jni::NativeImpl<ANRReporter, Impl>
|
class ANRReporter::Natives : public mozilla::jni::NativeImpl<ANRReporter, Impl>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "mozilla/jni/Accessors.h"
|
#include "mozilla/jni/Accessors.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace widget {
|
namespace java {
|
||||||
|
|
||||||
const char ANRReporter::name[] =
|
const char ANRReporter::name[] =
|
||||||
"org/mozilla/gecko/ANRReporter";
|
"org/mozilla/gecko/ANRReporter";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "mozilla/jni/Refs.h"
|
#include "mozilla/jni/Refs.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace widget {
|
namespace java {
|
||||||
|
|
||||||
class ANRReporter : public mozilla::jni::ObjectBase<ANRReporter, jobject>
|
class ANRReporter : public mozilla::jni::ObjectBase<ANRReporter, jobject>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
|
|
||||||
NativeJSContainer::LocalRef CreateNativeJSContainer(
|
java::NativeJSContainer::LocalRef
|
||||||
JSContext* cx, JS::HandleObject object);
|
CreateNativeJSContainer(JSContext* cx, JS::HandleObject object);
|
||||||
|
|
||||||
} // namespace widget
|
} // namespace widget
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class PrefsHelper
|
class PrefsHelper
|
||||||
: public widget::PrefsHelper::Natives<PrefsHelper>
|
: public java::PrefsHelper::Natives<PrefsHelper>
|
||||||
, public UsesGeckoThreadProxy
|
, public UsesGeckoThreadProxy
|
||||||
{
|
{
|
||||||
PrefsHelper() = delete;
|
PrefsHelper() = delete;
|
||||||
@@ -40,26 +40,26 @@ class PrefsHelper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t type = widget::PrefsHelper::PREF_INVALID;
|
int32_t type = java::PrefsHelper::PREF_INVALID;
|
||||||
bool boolVal = false;
|
bool boolVal = false;
|
||||||
int32_t intVal = 0;
|
int32_t intVal = 0;
|
||||||
nsAutoString strVal;
|
nsAutoString strVal;
|
||||||
|
|
||||||
switch (varType) {
|
switch (varType) {
|
||||||
case nsIDataType::VTYPE_BOOL:
|
case nsIDataType::VTYPE_BOOL:
|
||||||
type = widget::PrefsHelper::PREF_BOOL;
|
type = java::PrefsHelper::PREF_BOOL;
|
||||||
if (NS_FAILED(aVariant->GetAsBool(&boolVal))) {
|
if (NS_FAILED(aVariant->GetAsBool(&boolVal))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case nsIDataType::VTYPE_INT32:
|
case nsIDataType::VTYPE_INT32:
|
||||||
type = widget::PrefsHelper::PREF_INT;
|
type = java::PrefsHelper::PREF_INT;
|
||||||
if (NS_FAILED(aVariant->GetAsInt32(&intVal))) {
|
if (NS_FAILED(aVariant->GetAsInt32(&intVal))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case nsIDataType::VTYPE_ASTRING:
|
case nsIDataType::VTYPE_ASTRING:
|
||||||
type = widget::PrefsHelper::PREF_STRING;
|
type = java::PrefsHelper::PREF_STRING;
|
||||||
if (NS_FAILED(aVariant->GetAsAString(strVal))) {
|
if (NS_FAILED(aVariant->GetAsAString(strVal))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -70,16 +70,17 @@ class PrefsHelper
|
|||||||
|
|
||||||
Maybe<jni::StringParam> jstrVal;
|
Maybe<jni::StringParam> jstrVal;
|
||||||
jstrVal.emplace(nullptr);
|
jstrVal.emplace(nullptr);
|
||||||
if (type == widget::PrefsHelper::PREF_STRING) {
|
if (type == java::PrefsHelper::PREF_STRING) {
|
||||||
jstrVal.reset();
|
jstrVal.reset();
|
||||||
jstrVal.emplace(strVal, aPrefName.Env());
|
jstrVal.emplace(strVal, aPrefName.Env());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPrefHandler) {
|
if (aPrefHandler) {
|
||||||
widget::PrefsHelper::CallPrefHandler(
|
java::PrefsHelper::CallPrefHandler(
|
||||||
aPrefHandler, type, aPrefName, boolVal, intVal, jstrVal.ref());
|
aPrefHandler, type, aPrefName,
|
||||||
|
boolVal, intVal, jstrVal.ref());
|
||||||
} else {
|
} else {
|
||||||
widget::PrefsHelper::OnPrefChange(
|
java::PrefsHelper::OnPrefChange(
|
||||||
aPrefName, type, boolVal, intVal, jstrVal.ref());
|
aPrefName, type, boolVal, intVal, jstrVal.ref());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -97,13 +98,13 @@ class PrefsHelper
|
|||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
switch (aType) {
|
switch (aType) {
|
||||||
case widget::PrefsHelper::PREF_BOOL:
|
case java::PrefsHelper::PREF_BOOL:
|
||||||
rv = aVariant->SetAsBool(aBoolVal);
|
rv = aVariant->SetAsBool(aBoolVal);
|
||||||
break;
|
break;
|
||||||
case widget::PrefsHelper::PREF_INT:
|
case java::PrefsHelper::PREF_INT:
|
||||||
rv = aVariant->SetAsInt32(aIntVal);
|
rv = aVariant->SetAsInt32(aIntVal);
|
||||||
break;
|
break;
|
||||||
case widget::PrefsHelper::PREF_STRING:
|
case java::PrefsHelper::PREF_STRING:
|
||||||
rv = aVariant->SetAsAString(aStrVal->ToString());
|
rv = aVariant->SetAsAString(aStrVal->ToString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -149,23 +150,23 @@ public:
|
|||||||
jni::String::LocalRef nameStr(mozilla::Move(nameRef));
|
jni::String::LocalRef nameStr(mozilla::Move(nameRef));
|
||||||
const nsCString& name = nameStr->ToCString();
|
const nsCString& name = nameStr->ToCString();
|
||||||
|
|
||||||
int32_t type = widget::PrefsHelper::PREF_INVALID;
|
int32_t type = java::PrefsHelper::PREF_INVALID;
|
||||||
bool boolVal = false;
|
bool boolVal = false;
|
||||||
int32_t intVal = 0;
|
int32_t intVal = 0;
|
||||||
|
|
||||||
switch (Preferences::GetType(name.get())) {
|
switch (Preferences::GetType(name.get())) {
|
||||||
case nsIPrefBranch::PREF_BOOL:
|
case nsIPrefBranch::PREF_BOOL:
|
||||||
type = widget::PrefsHelper::PREF_BOOL;
|
type = java::PrefsHelper::PREF_BOOL;
|
||||||
boolVal = Preferences::GetBool(name.get());
|
boolVal = Preferences::GetBool(name.get());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nsIPrefBranch::PREF_INT:
|
case nsIPrefBranch::PREF_INT:
|
||||||
type = widget::PrefsHelper::PREF_INT;
|
type = java::PrefsHelper::PREF_INT;
|
||||||
intVal = Preferences::GetInt(name.get());
|
intVal = Preferences::GetInt(name.get());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nsIPrefBranch::PREF_STRING:
|
case nsIPrefBranch::PREF_STRING:
|
||||||
type = widget::PrefsHelper::PREF_STRING;
|
type = java::PrefsHelper::PREF_STRING;
|
||||||
strVal = Preferences::GetLocalizedString(name.get());
|
strVal = Preferences::GetLocalizedString(name.get());
|
||||||
if (!strVal) {
|
if (!strVal) {
|
||||||
strVal = Preferences::GetString(name.get());
|
strVal = Preferences::GetString(name.get());
|
||||||
@@ -195,17 +196,18 @@ public:
|
|||||||
|
|
||||||
Maybe<jni::StringParam> jstrVal;
|
Maybe<jni::StringParam> jstrVal;
|
||||||
jstrVal.emplace(nullptr);
|
jstrVal.emplace(nullptr);
|
||||||
if (type == widget::PrefsHelper::PREF_STRING) {
|
if (type == java::PrefsHelper::PREF_STRING) {
|
||||||
jstrVal.reset();
|
jstrVal.reset();
|
||||||
jstrVal.emplace(strVal, aCls.Env());
|
jstrVal.emplace(strVal, aCls.Env());
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::PrefsHelper::CallPrefHandler(
|
java::PrefsHelper::CallPrefHandler(
|
||||||
aPrefHandler, type, nameStr, boolVal, intVal, jstrVal.ref());
|
aPrefHandler, type, nameStr,
|
||||||
|
boolVal, intVal, jstrVal.ref());
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::PrefsHelper::CallPrefHandler(
|
java::PrefsHelper::CallPrefHandler(
|
||||||
aPrefHandler, widget::PrefsHelper::PREF_FINISH,
|
aPrefHandler, java::PrefsHelper::PREF_FINISH,
|
||||||
nullptr, false, 0, nullptr);
|
nullptr, false, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,13 +235,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (aType) {
|
switch (aType) {
|
||||||
case widget::PrefsHelper::PREF_BOOL:
|
case java::PrefsHelper::PREF_BOOL:
|
||||||
Preferences::SetBool(name.get(), aBoolVal);
|
Preferences::SetBool(name.get(), aBoolVal);
|
||||||
break;
|
break;
|
||||||
case widget::PrefsHelper::PREF_INT:
|
case java::PrefsHelper::PREF_INT:
|
||||||
Preferences::SetInt(name.get(), aIntVal);
|
Preferences::SetInt(name.get(), aIntVal);
|
||||||
break;
|
break;
|
||||||
case widget::PrefsHelper::PREF_STRING:
|
case java::PrefsHelper::PREF_STRING:
|
||||||
Preferences::SetString(name.get(), aStrVal->ToString());
|
Preferences::SetString(name.get(), aStrVal->ToString());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -301,15 +303,15 @@ public:
|
|||||||
|
|
||||||
switch (Preferences::GetType(name.get())) {
|
switch (Preferences::GetType(name.get())) {
|
||||||
case nsIPrefBranch::PREF_BOOL:
|
case nsIPrefBranch::PREF_BOOL:
|
||||||
type = widget::PrefsHelper::PREF_BOOL;
|
type = java::PrefsHelper::PREF_BOOL;
|
||||||
boolVal = Preferences::GetBool(name.get());
|
boolVal = Preferences::GetBool(name.get());
|
||||||
break;
|
break;
|
||||||
case nsIPrefBranch::PREF_INT:
|
case nsIPrefBranch::PREF_INT:
|
||||||
type = widget::PrefsHelper::PREF_INT;
|
type = java::PrefsHelper::PREF_INT;
|
||||||
intVal = Preferences::GetInt(name.get());
|
intVal = Preferences::GetInt(name.get());
|
||||||
break;
|
break;
|
||||||
case nsIPrefBranch::PREF_STRING:
|
case nsIPrefBranch::PREF_STRING:
|
||||||
type = widget::PrefsHelper::PREF_STRING;
|
type = java::PrefsHelper::PREF_STRING;
|
||||||
strVal = Preferences::GetLocalizedString(name.get());
|
strVal = Preferences::GetLocalizedString(name.get());
|
||||||
if (!strVal) {
|
if (!strVal) {
|
||||||
strVal = Preferences::GetString(name.get());
|
strVal = Preferences::GetString(name.get());
|
||||||
@@ -323,12 +325,13 @@ public:
|
|||||||
|
|
||||||
Maybe<jni::StringParam> jstrVal;
|
Maybe<jni::StringParam> jstrVal;
|
||||||
jstrVal.emplace(nullptr);
|
jstrVal.emplace(nullptr);
|
||||||
if (type == widget::PrefsHelper::PREF_STRING) {
|
if (type == java::PrefsHelper::PREF_STRING) {
|
||||||
jstrVal.reset();
|
jstrVal.reset();
|
||||||
jstrVal.emplace(strVal);
|
jstrVal.emplace(strVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::PrefsHelper::OnPrefChange(name, type, boolVal, intVal, jstrVal.ref());
|
java::PrefsHelper::OnPrefChange(
|
||||||
|
name, type, boolVal, intVal, jstrVal.ref());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class ThumbnailHelper final
|
class ThumbnailHelper final
|
||||||
: public widget::ThumbnailHelper::Natives<ThumbnailHelper>
|
: public java::ThumbnailHelper::Natives<ThumbnailHelper>
|
||||||
, public jni::UsesNativeCallProxy
|
, public jni::UsesNativeCallProxy
|
||||||
{
|
{
|
||||||
ThumbnailHelper() = delete;
|
ThumbnailHelper() = delete;
|
||||||
@@ -234,7 +234,7 @@ public:
|
|||||||
!tab ||
|
!tab ||
|
||||||
NS_FAILED(tab->GetWindow(getter_AddRefs(window))) ||
|
NS_FAILED(tab->GetWindow(getter_AddRefs(window))) ||
|
||||||
!window) {
|
!window) {
|
||||||
widget::ThumbnailHelper::SendThumbnail(
|
java::ThumbnailHelper::SendThumbnail(
|
||||||
aData, aTabId, /* success */ false, /* store */ false);
|
aData, aTabId, /* success */ false, /* store */ false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -244,7 +244,7 @@ public:
|
|||||||
const bool success = !!docShell;
|
const bool success = !!docShell;
|
||||||
const bool store = success ? ShouldStoreThumbnail(docShell) : false;
|
const bool store = success ? ShouldStoreThumbnail(docShell) : false;
|
||||||
|
|
||||||
widget::ThumbnailHelper::SendThumbnail(aData, aTabId, success, store);
|
java::ThumbnailHelper::SendThumbnail(aData, aTabId, success, store);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ bool HandleUncaughtException(JNIEnv* aEnv)
|
|||||||
MOZ_ASSERT(e);
|
MOZ_ASSERT(e);
|
||||||
|
|
||||||
aEnv->ExceptionClear();
|
aEnv->ExceptionClear();
|
||||||
String::LocalRef stack = widget::GeckoAppShell::HandleUncaughtException(e);
|
String::LocalRef stack = java::GeckoAppShell::HandleUncaughtException(e);
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
if (stack) {
|
if (stack) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class AndroidInputStream : public nsIInputStream
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AndroidInputStream(jni::Object::Param connection) {
|
AndroidInputStream(jni::Object::Param connection) {
|
||||||
mBridgeInputStream = widget::GeckoAppShell::CreateInputStream(connection);
|
mBridgeInputStream = java::GeckoAppShell::CreateInputStream(connection);
|
||||||
mBridgeChannel = AndroidBridge::ChannelCreate(mBridgeInputStream);
|
mBridgeChannel = AndroidBridge::ChannelCreate(mBridgeInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ private:
|
|||||||
mConnection = aConnection;
|
mConnection = aConnection;
|
||||||
SetURI(aURI);
|
SetURI(aURI);
|
||||||
|
|
||||||
auto type = widget::GeckoAppShell::ConnectionGetMimeType(mConnection);
|
auto type = java::GeckoAppShell::ConnectionGetMimeType(mConnection);
|
||||||
if (type) {
|
if (type) {
|
||||||
SetContentType(type->ToCString());
|
SetContentType(type->ToCString());
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public:
|
|||||||
nsCString spec;
|
nsCString spec;
|
||||||
aURI->GetSpec(spec);
|
aURI->GetSpec(spec);
|
||||||
|
|
||||||
auto connection = widget::GeckoAppShell::GetConnection(spec);
|
auto connection = java::GeckoAppShell::GetConnection(spec);
|
||||||
return connection ? new AndroidChannel(aURI, connection) : nullptr;
|
return connection ? new AndroidChannel(aURI, connection) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
NS_DECL_ISUPPORTS;
|
NS_DECL_ISUPPORTS;
|
||||||
|
|
||||||
nsresult Callback(const nsAString& topic, const nsAString& state) override {
|
nsresult Callback(const nsAString& topic, const nsAString& state) override {
|
||||||
widget::GeckoAppShell::NotifyWakeLockChanged(topic, state);
|
java::GeckoAppShell::NotifyWakeLockChanged(topic, state);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -100,7 +100,7 @@ StaticRefPtr<WakeLockListener> sWakeLockListener;
|
|||||||
|
|
||||||
|
|
||||||
class GeckoThreadSupport final
|
class GeckoThreadSupport final
|
||||||
: public widget::GeckoThread::Natives<GeckoThreadSupport>
|
: public java::GeckoThread::Natives<GeckoThreadSupport>
|
||||||
, public UsesGeckoThreadProxy
|
, public UsesGeckoThreadProxy
|
||||||
{
|
{
|
||||||
static uint32_t sPauseCount;
|
static uint32_t sPauseCount;
|
||||||
@@ -220,7 +220,7 @@ uint32_t GeckoThreadSupport::sPauseCount;
|
|||||||
|
|
||||||
|
|
||||||
class GeckoAppShellSupport final
|
class GeckoAppShellSupport final
|
||||||
: public widget::GeckoAppShell::Natives<GeckoAppShellSupport>
|
: public java::GeckoAppShell::Natives<GeckoAppShellSupport>
|
||||||
, public UsesGeckoThreadProxy
|
, public UsesGeckoThreadProxy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -356,7 +356,7 @@ nsAppShell::nsAppShell()
|
|||||||
mozilla::ThumbnailHelper::Init();
|
mozilla::ThumbnailHelper::Init();
|
||||||
nsWindow::InitNatives();
|
nsWindow::InitNatives();
|
||||||
|
|
||||||
widget::GeckoThread::SetState(widget::GeckoThread::State::JNI_READY());
|
java::GeckoThread::SetState(java::GeckoThread::State::JNI_READY());
|
||||||
}
|
}
|
||||||
|
|
||||||
sPowerManagerService = do_GetService(POWERMANAGERSERVICE_CONTRACTID);
|
sPowerManagerService = do_GetService(POWERMANAGERSERVICE_CONTRACTID);
|
||||||
@@ -458,11 +458,11 @@ nsAppShell::Observe(nsISupports* aSubject,
|
|||||||
if (jni::IsAvailable()) {
|
if (jni::IsAvailable()) {
|
||||||
// See if we want to force 16-bit color before doing anything
|
// See if we want to force 16-bit color before doing anything
|
||||||
if (Preferences::GetBool("gfx.android.rgb16.force", false)) {
|
if (Preferences::GetBool("gfx.android.rgb16.force", false)) {
|
||||||
widget::GeckoAppShell::SetScreenDepthOverride(16);
|
java::GeckoAppShell::SetScreenDepthOverride(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::GeckoThread::SetState(
|
java::GeckoThread::SetState(
|
||||||
widget::GeckoThread::State::PROFILE_READY());
|
java::GeckoThread::State::PROFILE_READY());
|
||||||
|
|
||||||
// Gecko on Android follows the Android app model where it never
|
// Gecko on Android follows the Android app model where it never
|
||||||
// stops until it is killed by the system or told explicitly to
|
// stops until it is killed by the system or told explicitly to
|
||||||
@@ -480,16 +480,16 @@ nsAppShell::Observe(nsISupports* aSubject,
|
|||||||
} else if (!strcmp(aTopic, "chrome-document-loaded")) {
|
} else if (!strcmp(aTopic, "chrome-document-loaded")) {
|
||||||
if (jni::IsAvailable()) {
|
if (jni::IsAvailable()) {
|
||||||
// Our first window has loaded, assume any JS initialization has run.
|
// Our first window has loaded, assume any JS initialization has run.
|
||||||
widget::GeckoThread::CheckAndSetState(
|
java::GeckoThread::CheckAndSetState(
|
||||||
widget::GeckoThread::State::PROFILE_READY(),
|
java::GeckoThread::State::PROFILE_READY(),
|
||||||
widget::GeckoThread::State::RUNNING());
|
java::GeckoThread::State::RUNNING());
|
||||||
}
|
}
|
||||||
removeObserver = true;
|
removeObserver = true;
|
||||||
|
|
||||||
} else if (!strcmp(aTopic, "quit-application-granted")) {
|
} else if (!strcmp(aTopic, "quit-application-granted")) {
|
||||||
if (jni::IsAvailable()) {
|
if (jni::IsAvailable()) {
|
||||||
widget::GeckoThread::SetState(
|
java::GeckoThread::SetState(
|
||||||
widget::GeckoThread::State::EXITING());
|
java::GeckoThread::State::EXITING());
|
||||||
|
|
||||||
// We are told explicitly to quit, perhaps due to
|
// We are told explicitly to quit, perhaps due to
|
||||||
// nsIAppStartup::Quit being called. We should release our hold on
|
// nsIAppStartup::Quit being called. We should release our hold on
|
||||||
@@ -817,8 +817,7 @@ nsAppShell::LegacyGeckoEvent::Run()
|
|||||||
dom::GamepadMappingType::Standard,
|
dom::GamepadMappingType::Standard,
|
||||||
dom::kStandardGamepadButtons,
|
dom::kStandardGamepadButtons,
|
||||||
dom::kStandardGamepadAxes);
|
dom::kStandardGamepadAxes);
|
||||||
widget::GeckoAppShell::GamepadAdded(curEvent->ID(),
|
java::GeckoAppShell::GamepadAdded(curEvent->ID(), svc_id);
|
||||||
svc_id);
|
|
||||||
} else if (curEvent->Action() == AndroidGeckoEvent::ACTION_GAMEPAD_REMOVED) {
|
} else if (curEvent->Action() == AndroidGeckoEvent::ACTION_GAMEPAD_REMOVED) {
|
||||||
service->RemoveGamepad(curEvent->ID());
|
service->RemoveGamepad(curEvent->ID());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ nsClipboard::SetData(nsITransferable *aTransferable,
|
|||||||
nsAutoString buffer;
|
nsAutoString buffer;
|
||||||
supportsString->GetData(buffer);
|
supportsString->GetData(buffer);
|
||||||
|
|
||||||
widget::Clipboard::SetClipboardText(buffer);
|
java::Clipboard::SetClipboardText(buffer);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard)
|
|||||||
{
|
{
|
||||||
if (aWhichClipboard != kGlobalClipboard)
|
if (aWhichClipboard != kGlobalClipboard)
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
widget::Clipboard::ClearText();
|
java::Clipboard::ClearText();
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList,
|
|||||||
|
|
||||||
for (uint32_t k = 0; k < aLength; k++) {
|
for (uint32_t k = 0; k < aLength; k++) {
|
||||||
if (strcmp(aFlavorList[k], kUnicodeMime) == 0) {
|
if (strcmp(aFlavorList[k], kUnicodeMime) == 0) {
|
||||||
*aHasText = widget::Clipboard::HasText();
|
*aHasText = java::Clipboard::HasText();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ nsLookAndFeel::GetEchoPasswordImpl()
|
|||||||
{
|
{
|
||||||
if (!mInitializedShowPassword) {
|
if (!mInitializedShowPassword) {
|
||||||
if (XRE_IsParentProcess()) {
|
if (XRE_IsParentProcess()) {
|
||||||
mShowPassword = widget::GeckoAppShell::GetShowPasswordSetting();
|
mShowPassword = java::GeckoAppShell::GetShowPasswordSetting();
|
||||||
} else {
|
} else {
|
||||||
ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
|
ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include "nsScreenManagerAndroid.h"
|
#include "nsScreenManagerAndroid.h"
|
||||||
#include "nsWindow.h"
|
#include "nsWindow.h"
|
||||||
#include "AndroidBridge.h"
|
|
||||||
#include "GeneratedJNIWrappers.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#include "AndroidRect.h"
|
#include "AndroidRect.h"
|
||||||
#include <mozilla/jni/Refs.h>
|
#include <mozilla/jni/Refs.h>
|
||||||
@@ -38,7 +37,7 @@ nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, i
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
widget::sdk::Rect::LocalRef rect = widget::GeckoAppShell::GetScreenSize();
|
java::sdk::Rect::LocalRef rect = java::GeckoAppShell::GetScreenSize();
|
||||||
rect->Left(outLeft);
|
rect->Left(outLeft);
|
||||||
rect->Top(outTop);
|
rect->Top(outTop);
|
||||||
rect->Width(outWidth);
|
rect->Width(outWidth);
|
||||||
@@ -65,7 +64,7 @@ nsScreenAndroid::GetPixelDepth(int32_t *aPixelDepth)
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*aPixelDepth = widget::GeckoAppShell::GetScreenDepthWrapper();
|
*aPixelDepth = java::GeckoAppShell::GetScreenDepthWrapper();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +79,7 @@ void
|
|||||||
nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
|
nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
|
||||||
{
|
{
|
||||||
if (mozilla::jni::IsAvailable()) {
|
if (mozilla::jni::IsAvailable()) {
|
||||||
widget::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
|
java::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,9 @@ using mozilla::Unused;
|
|||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
using namespace mozilla::widget;
|
|
||||||
using namespace mozilla::layers;
|
using namespace mozilla::layers;
|
||||||
|
using namespace mozilla::java;
|
||||||
|
using namespace mozilla::widget;
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
|
NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
|
||||||
|
|
||||||
@@ -277,8 +278,7 @@ private:
|
|||||||
, mOldEnd(aIMENotification.mTextChangeData.mRemovedEndOffset)
|
, mOldEnd(aIMENotification.mTextChangeData.mRemovedEndOffset)
|
||||||
, mNewEnd(aIMENotification.mTextChangeData.mAddedEndOffset)
|
, mNewEnd(aIMENotification.mTextChangeData.mAddedEndOffset)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aIMENotification.mMessage ==
|
MOZ_ASSERT(aIMENotification.mMessage == NOTIFY_IME_OF_TEXT_CHANGE,
|
||||||
mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE,
|
|
||||||
"IMETextChange initialized with wrong notification");
|
"IMETextChange initialized with wrong notification");
|
||||||
MOZ_ASSERT(aIMENotification.mTextChangeData.IsValid(),
|
MOZ_ASSERT(aIMENotification.mTextChangeData.IsValid(),
|
||||||
"The text change notification isn't initialized");
|
"The text change notification isn't initialized");
|
||||||
@@ -290,7 +290,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// GeckoEditable instance used by this nsWindow;
|
// GeckoEditable instance used by this nsWindow;
|
||||||
mozilla::widget::GeckoEditable::GlobalRef mEditable;
|
java::GeckoEditable::GlobalRef mEditable;
|
||||||
AutoTArray<mozilla::UniquePtr<mozilla::WidgetEvent>, 8> mIMEKeyEvents;
|
AutoTArray<mozilla::UniquePtr<mozilla::WidgetEvent>, 8> mIMEKeyEvents;
|
||||||
AutoTArray<IMETextChange, 4> mIMETextChanges;
|
AutoTArray<IMETextChange, 4> mIMETextChanges;
|
||||||
InputContext mInputContext;
|
InputContext mInputContext;
|
||||||
@@ -568,13 +568,13 @@ public:
|
|||||||
MouseInput::ButtonType result = MouseInput::NONE;
|
MouseInput::ButtonType result = MouseInput::NONE;
|
||||||
|
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case widget::sdk::MotionEvent::BUTTON_PRIMARY:
|
case java::sdk::MotionEvent::BUTTON_PRIMARY:
|
||||||
result = MouseInput::LEFT_BUTTON;
|
result = MouseInput::LEFT_BUTTON;
|
||||||
break;
|
break;
|
||||||
case widget::sdk::MotionEvent::BUTTON_SECONDARY:
|
case java::sdk::MotionEvent::BUTTON_SECONDARY:
|
||||||
result = MouseInput::RIGHT_BUTTON;
|
result = MouseInput::RIGHT_BUTTON;
|
||||||
break;
|
break;
|
||||||
case widget::sdk::MotionEvent::BUTTON_TERTIARY:
|
case java::sdk::MotionEvent::BUTTON_TERTIARY:
|
||||||
result = MouseInput::MIDDLE_BUTTON;
|
result = MouseInput::MIDDLE_BUTTON;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -587,19 +587,19 @@ public:
|
|||||||
static int16_t ConvertButtons(int buttons) {
|
static int16_t ConvertButtons(int buttons) {
|
||||||
int16_t result = 0;
|
int16_t result = 0;
|
||||||
|
|
||||||
if (buttons & widget::sdk::MotionEvent::BUTTON_PRIMARY) {
|
if (buttons & java::sdk::MotionEvent::BUTTON_PRIMARY) {
|
||||||
result |= WidgetMouseEventBase::eLeftButtonFlag;
|
result |= WidgetMouseEventBase::eLeftButtonFlag;
|
||||||
}
|
}
|
||||||
if (buttons & widget::sdk::MotionEvent::BUTTON_SECONDARY) {
|
if (buttons & java::sdk::MotionEvent::BUTTON_SECONDARY) {
|
||||||
result |= WidgetMouseEventBase::eRightButtonFlag;
|
result |= WidgetMouseEventBase::eRightButtonFlag;
|
||||||
}
|
}
|
||||||
if (buttons & widget::sdk::MotionEvent::BUTTON_TERTIARY) {
|
if (buttons & java::sdk::MotionEvent::BUTTON_TERTIARY) {
|
||||||
result |= WidgetMouseEventBase::eMiddleButtonFlag;
|
result |= WidgetMouseEventBase::eMiddleButtonFlag;
|
||||||
}
|
}
|
||||||
if (buttons & widget::sdk::MotionEvent::BUTTON_BACK) {
|
if (buttons & java::sdk::MotionEvent::BUTTON_BACK) {
|
||||||
result |= WidgetMouseEventBase::e4thButtonFlag;
|
result |= WidgetMouseEventBase::e4thButtonFlag;
|
||||||
}
|
}
|
||||||
if (buttons & widget::sdk::MotionEvent::BUTTON_FORWARD) {
|
if (buttons & java::sdk::MotionEvent::BUTTON_FORWARD) {
|
||||||
result |= WidgetMouseEventBase::e5thButtonFlag;
|
result |= WidgetMouseEventBase::e5thButtonFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2466,7 +2466,7 @@ ConvertAndroidScanCodeToCodeNameIndex(int scanCode)
|
|||||||
static bool
|
static bool
|
||||||
IsModifierKey(int32_t keyCode)
|
IsModifierKey(int32_t keyCode)
|
||||||
{
|
{
|
||||||
using mozilla::widget::sdk::KeyEvent;
|
using mozilla::java::sdk::KeyEvent;
|
||||||
return keyCode == KeyEvent::KEYCODE_ALT_LEFT ||
|
return keyCode == KeyEvent::KEYCODE_ALT_LEFT ||
|
||||||
keyCode == KeyEvent::KEYCODE_ALT_RIGHT ||
|
keyCode == KeyEvent::KEYCODE_ALT_RIGHT ||
|
||||||
keyCode == KeyEvent::KEYCODE_SHIFT_LEFT ||
|
keyCode == KeyEvent::KEYCODE_SHIFT_LEFT ||
|
||||||
@@ -2480,7 +2480,7 @@ IsModifierKey(int32_t keyCode)
|
|||||||
static Modifiers
|
static Modifiers
|
||||||
GetModifiers(int32_t metaState)
|
GetModifiers(int32_t metaState)
|
||||||
{
|
{
|
||||||
using mozilla::widget::sdk::KeyEvent;
|
using mozilla::java::sdk::KeyEvent;
|
||||||
return (metaState & KeyEvent::META_ALT_MASK ? MODIFIER_ALT : 0)
|
return (metaState & KeyEvent::META_ALT_MASK ? MODIFIER_ALT : 0)
|
||||||
| (metaState & KeyEvent::META_SHIFT_MASK ? MODIFIER_SHIFT : 0)
|
| (metaState & KeyEvent::META_SHIFT_MASK ? MODIFIER_SHIFT : 0)
|
||||||
| (metaState & KeyEvent::META_CTRL_MASK ? MODIFIER_CONTROL : 0)
|
| (metaState & KeyEvent::META_CTRL_MASK ? MODIFIER_CONTROL : 0)
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ private:
|
|||||||
void CreateLayerManager(int aCompositorWidth, int aCompositorHeight);
|
void CreateLayerManager(int aCompositorWidth, int aCompositorHeight);
|
||||||
void RedrawAll();
|
void RedrawAll();
|
||||||
|
|
||||||
mozilla::widget::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
|
mozilla::java::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* NSWINDOW_H_ */
|
#endif /* NSWINDOW_H_ */
|
||||||
|
|||||||
@@ -867,7 +867,7 @@ nsSystemInfo::GetAndroidSystemInfo(AndroidSystemInfo* aInfo)
|
|||||||
sdk_version = 0;
|
sdk_version = 0;
|
||||||
}
|
}
|
||||||
aInfo->sdk_version() = sdk_version;
|
aInfo->sdk_version() = sdk_version;
|
||||||
aInfo->isTablet() = mozilla::widget::GeckoAppShell::IsTablet();
|
aInfo->isTablet() = java::GeckoAppShell::IsTablet();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
|
|||||||
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
|
mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
|
||||||
"RELEASE",
|
"RELEASE",
|
||||||
osVersion);
|
osVersion);
|
||||||
isTablet = mozilla::widget::GeckoAppShell::IsTablet();
|
isTablet = java::GeckoAppShell::IsTablet();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ static nsresult MacErrorMapper(OSErr inErr);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "GeneratedJNIWrappers.h"
|
||||||
#include "nsIMIMEService.h"
|
#include "nsIMIMEService.h"
|
||||||
#include <linux/magic.h>
|
#include <linux/magic.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -2023,7 +2023,7 @@ nsLocalFile::Launch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
|
nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
|
||||||
return widget::GeckoAppShell::OpenUriExternal(
|
return java::GeckoAppShell::OpenUriExternal(
|
||||||
NS_ConvertUTF8toUTF16(fileUri),
|
NS_ConvertUTF8toUTF16(fileUri),
|
||||||
NS_ConvertUTF8toUTF16(type),
|
NS_ConvertUTF8toUTF16(type),
|
||||||
EmptyString(),
|
EmptyString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user