diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 0e0e4b59d94..20e977fd358 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1882,7 +1882,7 @@ ContentParent::RecvGetShowPasswordSetting(bool* showPassword) #ifdef MOZ_WIDGET_ANDROID NS_ASSERTION(AndroidBridge::Bridge() != nullptr, "AndroidBridge is not available"); - *showPassword = GeckoAppShell::GetShowPasswordSetting(); + *showPassword = mozilla::widget::android::GeckoAppShell::GetShowPasswordSetting(); #endif return true; } diff --git a/dom/plugins/base/android/ANPSystem.cpp b/dom/plugins/base/android/ANPSystem.cpp index 7d9c17b7f61..77450f6e0d3 100644 --- a/dom/plugins/base/android/ANPSystem.cpp +++ b/dom/plugins/base/android/ANPSystem.cpp @@ -63,7 +63,7 @@ jclass anp_system_loadJavaClass(NPP instance, const char* classNameStr) lib->GetLibraryPath(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) diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 5449f8964b8..461f81693ec 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -541,7 +541,7 @@ MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, const char *target, // Set aCallNotify here to false. If pluginHost->GetURL or PostURL fail, // the listener's destructor will do the notification while we are about to // return a failure code. - // Call SetCallNotify(true) below after we are sure we cannot return a failure + // Call SetCallNotify(true) below after we are sure we cannot return a failure // code. if (!target) { inst->NewStreamListener(relativeURL, notifyData, @@ -612,7 +612,7 @@ public: return (mFunc != nullptr); } -private: +private: NPP mInstance; PluginThreadCallback mFunc; void *mUserData; @@ -1064,10 +1064,10 @@ _destroystream(NPP npp, NPStream *pstream, NPError reason) // This type of stream (NPStream) was created via NPN_NewStream. The plugin holds // the reference until it is to be deleted here. Deleting the wrapper will // release the wrapped nsIOutputStream. - // + // // The NPStream the plugin references should always be a sub-object of it's own // 'ndata', which is our nsNPAPIStramWrapper. See bug 548441. - NS_ASSERTION((char*)streamWrapper <= (char*)pstream && + NS_ASSERTION((char*)streamWrapper <= (char*)pstream && ((char*)pstream) + sizeof(*pstream) <= ((char*)streamWrapper) + sizeof(*streamWrapper), "pstream is not a subobject of wrapper"); @@ -2250,10 +2250,10 @@ _getvalue(NPP npp, NPNVariable variable, void *result) uint32_t* bits = reinterpret_cast(result); *bits = kBitmap_ANPDrawingModel && kSurface_ANPDrawingModel; return NPERR_NO_ERROR; - } + } case kJavaContext_ANPGetValue: { - jobject ret = GeckoAppShell::GetContext(); + jobject ret = mozilla::widget::android::GeckoAppShell::GetContext(); if (!ret) return NPERR_GENERIC_ERROR; diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index 44ca1a9a8a8..e43b7f9ea47 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -870,7 +870,7 @@ void nsNPAPIPluginInstance::NotifyFullScreen(bool aFullScreen) SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction); 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 if (mFullScreenOrientation != dom::eScreenOrientation_None) { - GeckoAppShell::LockScreenOrientation(mFullScreenOrientation); + mozilla::widget::android::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation); } else if (oldOrientation != dom::eScreenOrientation_None) { // We applied an orientation when we entered fullscreen, but // we don't want it anymore - GeckoAppShell::UnlockScreenOrientation(); + mozilla::widget::android::GeckoAppShell::UnlockScreenOrientation(); } } } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index aae0fc16361..b7aa1b113af 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1465,7 +1465,7 @@ void nsPluginInstanceOwner::RemovePluginView() if (!mInstance || !mJavaView) return; - GeckoAppShell::RemovePluginView((jobject)mJavaView, mFullScreen); + mozilla::widget::android::GeckoAppShell::RemovePluginView((jobject)mJavaView, mFullScreen); AndroidBridge::GetJNIEnv()->DeleteGlobalRef((jobject)mJavaView); mJavaView = nullptr; diff --git a/dom/system/android/AndroidLocationProvider.cpp b/dom/system/android/AndroidLocationProvider.cpp index e26204fb144..5fab3c175b3 100644 --- a/dom/system/android/AndroidLocationProvider.cpp +++ b/dom/system/android/AndroidLocationProvider.cpp @@ -26,7 +26,7 @@ AndroidLocationProvider::~AndroidLocationProvider() NS_IMETHODIMP AndroidLocationProvider::Startup() { - GeckoAppShell::EnableLocation(true); + mozilla::widget::android::GeckoAppShell::EnableLocation(true); return NS_OK; } @@ -42,13 +42,13 @@ AndroidLocationProvider::Watch(nsIGeolocationUpdate* aCallback) NS_IMETHODIMP AndroidLocationProvider::Shutdown() { - GeckoAppShell::EnableLocation(false); + mozilla::widget::android::GeckoAppShell::EnableLocation(false); return NS_OK; } NS_IMETHODIMP AndroidLocationProvider::SetHighAccuracy(bool enable) { - GeckoAppShell::EnableLocationHighAccuracy(enable); + mozilla::widget::android::GeckoAppShell::EnableLocationHighAccuracy(enable); return NS_OK; } diff --git a/dom/system/android/nsHapticFeedback.cpp b/dom/system/android/nsHapticFeedback.cpp index 4e0bba6aa22..8b9fbf07b1d 100644 --- a/dom/system/android/nsHapticFeedback.cpp +++ b/dom/system/android/nsHapticFeedback.cpp @@ -14,6 +14,6 @@ NS_IMPL_ISUPPORTS1(nsHapticFeedback, nsIHapticFeedback) NS_IMETHODIMP nsHapticFeedback::PerformSimpleAction(int32_t aType) { - GeckoAppShell::PerformHapticFeedback(aType == LongPress); + mozilla::widget::android::GeckoAppShell::PerformHapticFeedback(aType == LongPress); return NS_OK; } diff --git a/gfx/layers/d3d10/ImageLayerD3D10.h b/gfx/layers/d3d10/ImageLayerD3D10.h index d6281949ab0..e362dff2129 100644 --- a/gfx/layers/d3d10/ImageLayerD3D10.h +++ b/gfx/layers/d3d10/ImageLayerD3D10.h @@ -11,8 +11,6 @@ #include "ImageContainer.h" #include "yuv_convert.h" -using namespace mozilla::gfx; - namespace mozilla { namespace layers { @@ -63,11 +61,11 @@ public: already_AddRefed DeprecatedGetAsSurface(); virtual TemporaryRef GetAsSourceSurface() MOZ_OVERRIDE; - IntSize GetSize() { return mSize; } + mozilla::gfx::IntSize GetSize() { return mSize; } TextureD3D10BackendData *GetD3D10TextureBackendData(ID3D10Device *aDevice); - IntSize mSize; + mozilla::gfx::IntSize mSize; RemoteImageData::Format mFormat; HANDLE mHandle; }; diff --git a/gfx/thebes/nsSurfaceTexture.cpp b/gfx/thebes/nsSurfaceTexture.cpp index 45771c1ca3c..55ee0143064 100644 --- a/gfx/thebes/nsSurfaceTexture.cpp +++ b/gfx/thebes/nsSurfaceTexture.cpp @@ -194,7 +194,7 @@ nsSurfaceTexture::~nsSurfaceTexture() JNIEnv* env = GetJNIForThread(); if (mSurfaceTexture) { - GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); + mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); env->DeleteGlobalRef(mSurfaceTexture); mSurfaceTexture = nullptr; @@ -223,9 +223,9 @@ void nsSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable) { if (aRunnable) - GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID); + mozilla::widget::android::GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID); else - GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); + mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); mFrameAvailableCallback = aRunnable; } diff --git a/hal/android/AndroidHal.cpp b/hal/android/AndroidHal.cpp index e97ff5b718b..df0eebdebe8 100644 --- a/hal/android/AndroidHal.cpp +++ b/hal/android/AndroidHal.cpp @@ -55,19 +55,19 @@ CancelVibrate(const WindowIdentifier &) { // Ignore WindowIdentifier parameter. - GeckoAppShell::CancelVibrate(); + mozilla::widget::android::GeckoAppShell::CancelVibrate(); } void EnableBatteryNotifications() { - GeckoAppShell::EnableBatteryNotifications(); + mozilla::widget::android::GeckoAppShell::EnableBatteryNotifications(); } void DisableBatteryNotifications() { - GeckoAppShell::DisableBatteryNotifications(); + mozilla::widget::android::GeckoAppShell::DisableBatteryNotifications(); } void @@ -79,13 +79,13 @@ GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo) void EnableNetworkNotifications() { - GeckoAppShell::EnableNetworkNotifications(); + mozilla::widget::android::GeckoAppShell::EnableNetworkNotifications(); } void DisableNetworkNotifications() { - GeckoAppShell::DisableNetworkNotifications(); + mozilla::widget::android::GeckoAppShell::DisableNetworkNotifications(); } void @@ -97,13 +97,13 @@ GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo) void EnableScreenConfigurationNotifications() { - GeckoAppShell::EnableScreenOrientationNotifications(); + mozilla::widget::android::GeckoAppShell::EnableScreenOrientationNotifications(); } void DisableScreenConfigurationNotifications() { - GeckoAppShell::DisableScreenOrientationNotifications(); + mozilla::widget::android::GeckoAppShell::DisableScreenOrientationNotifications(); } void @@ -149,7 +149,7 @@ LockScreenOrientation(const ScreenOrientation& aOrientation) case eScreenOrientation_LandscapeSecondary: case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary: case eScreenOrientation_Default: - GeckoAppShell::LockScreenOrientation(aOrientation); + mozilla::widget::android::GeckoAppShell::LockScreenOrientation(aOrientation); return true; default: return false; @@ -159,7 +159,7 @@ LockScreenOrientation(const ScreenOrientation& aOrientation) void UnlockScreenOrientation() { - GeckoAppShell::UnlockScreenOrientation(); + mozilla::widget::android::GeckoAppShell::UnlockScreenOrientation(); } } // hal_impl diff --git a/hal/android/AndroidSensor.cpp b/hal/android/AndroidSensor.cpp index 3c88027a58e..357137f608f 100644 --- a/hal/android/AndroidSensor.cpp +++ b/hal/android/AndroidSensor.cpp @@ -13,12 +13,12 @@ namespace hal_impl { void EnableSensorNotifications(SensorType aSensor) { - GeckoAppShell::EnableSensor(aSensor); + mozilla::widget::android::GeckoAppShell::EnableSensor(aSensor); } void DisableSensorNotifications(SensorType aSensor) { - GeckoAppShell::DisableSensor(aSensor); + mozilla::widget::android::GeckoAppShell::DisableSensor(aSensor); } } // hal_impl diff --git a/ipc/glue/MessagePump.cpp b/ipc/glue/MessagePump.cpp index 7382ee414ff..306dd175fa3 100644 --- a/ipc/glue/MessagePump.cpp +++ b/ipc/glue/MessagePump.cpp @@ -106,7 +106,7 @@ MessagePump::Run(MessagePump::Delegate* aDelegate) // get here if the normal Gecko event loop has been awoken above. // Bug 750713 if (MOZ_LIKELY(AndroidBridge::HasEnv())) { - did_work |= GeckoAppShell::PumpMessageLoop(); + did_work |= mozilla::widget::android::GeckoAppShell::PumpMessageLoop(); } #endif diff --git a/media/webrtc/signaling/src/media/CSFMediaProvider.h b/media/webrtc/signaling/src/media/CSFMediaProvider.h index 2be41456171..d61f8c067ec 100644 --- a/media/webrtc/signaling/src/media/CSFMediaProvider.h +++ b/media/webrtc/signaling/src/media/CSFMediaProvider.h @@ -9,8 +9,6 @@ #include -using namespace std; - namespace CSF { class AudioControl; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index a31887f2819..8c6b2f5b8b1 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -113,7 +113,7 @@ public: void Init() { nsCOMPtr observerService = - mozilla::services::GetObserverService(); + services::GetObserverService(); if (!observerService) return; @@ -131,7 +131,7 @@ public: virtual ~PeerConnectionCtxShutdown() { nsCOMPtr observerService = - mozilla::services::GetObserverService(); + services::GetObserverService(); if (observerService) observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); } @@ -143,7 +143,7 @@ public: sipcc::PeerConnectionCtx::Destroy(); nsCOMPtr observerService = - mozilla::services::GetObserverService(); + services::GetObserverService(); if (!observerService) return NS_ERROR_FAILURE; @@ -162,11 +162,12 @@ public: NS_IMPL_ISUPPORTS1(PeerConnectionCtxShutdown, nsIObserver); } +using namespace mozilla; namespace sipcc { PeerConnectionCtx* PeerConnectionCtx::gInstance; nsIThread* PeerConnectionCtx::gMainThread; -StaticRefPtr PeerConnectionCtx::gPeerConnectionCtxShutdown; +StaticRefPtr PeerConnectionCtx::gPeerConnectionCtxShutdown; // 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 @@ -293,7 +294,7 @@ nsresult PeerConnectionCtx::Initialize() { mDevice = mCCM->getActiveDevice(); mCCM->addCCObserver(this); 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 // 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(); // We are keeping this in a local var to avoid a data race // with ChangeSipccState in the debug message and compound if below - mozilla::dom::PCImplSipccState currentSipccState = mSipccState; + dom::PCImplSipccState currentSipccState = mSipccState; switch (aDeviceEvent) { case CCAPI_DEVICE_EV_STATE: @@ -337,9 +338,9 @@ void PeerConnectionCtx::onDeviceEvent(ccapi_device_event_e aDeviceEvent, if (CC_STATE_INS == state) { // SIPCC is up - if (mozilla::dom::PCImplSipccState::Starting == currentSipccState || - mozilla::dom::PCImplSipccState::Idle == currentSipccState) { - ChangeSipccState(mozilla::dom::PCImplSipccState::Started); + if (dom::PCImplSipccState::Starting == currentSipccState || + dom::PCImplSipccState::Idle == currentSipccState) { + ChangeSipccState(dom::PCImplSipccState::Started); } else { CSFLogError(logTag, "%s PeerConnection already started", __FUNCTION__); } diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h index c14a557946d..e2326e3788b 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h @@ -43,8 +43,6 @@ protected: namespace sipcc { -using namespace mozilla; - class OnCallEventArgs { public: OnCallEventArgs(ccapi_call_event_e aCallEvent, CSF::CC_CallInfoPtr aInfo) @@ -111,7 +109,7 @@ class PeerConnectionCtx : public CSF::CC_Observer { static PeerConnectionCtx *gInstance; public: static nsIThread *gMainThread; - static StaticRefPtr gPeerConnectionCtxShutdown; + static mozilla::StaticRefPtr gPeerConnectionCtxShutdown; }; } // namespace sipcc diff --git a/media/webrtc/signaling/test/FakePCObserver.h b/media/webrtc/signaling/test/FakePCObserver.h index ddb42734168..a14f056ab93 100644 --- a/media/webrtc/signaling/test/FakePCObserver.h +++ b/media/webrtc/signaling/test/FakePCObserver.h @@ -31,7 +31,6 @@ class nsIDOMWindow; class nsIDOMDataChannel; namespace test { -using namespace mozilla::dom; class AFakePCObserver : public nsSupportsWeakReference { @@ -81,7 +80,7 @@ public: virtual NS_IMETHODIMP NotifyConnection(ER&) = 0; virtual NS_IMETHODIMP NotifyClosedConnection(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; virtual NS_IMETHODIMP OnAddStream(nsIDOMMediaStream *stream, ER&) = 0; virtual NS_IMETHODIMP OnRemoveStream(ER&) = 0; diff --git a/mobile/android/components/build/nsAndroidHistory.cpp b/mobile/android/components/build/nsAndroidHistory.cpp index 7a563bde271..db49ef53b91 100644 --- a/mobile/android/components/build/nsAndroidHistory.cpp +++ b/mobile/android/components/build/nsAndroidHistory.cpp @@ -63,7 +63,7 @@ nsAndroidHistory::RegisterVisitedCallback(nsIURI *aURI, Link *aContent) list->AppendElement(aContent); if (AndroidBridge::HasEnv()) { - GeckoAppShell::CheckURIVisited(uriString); + mozilla::widget::android::GeckoAppShell::CheckURIVisited(uriString); } return NS_OK; @@ -180,7 +180,7 @@ nsAndroidHistory::VisitURI(nsIURI *aURI, nsIURI *aLastVisitedURI, uint32_t aFlag rv = aURI->GetSpec(uri); if (NS_FAILED(rv)) return rv; NS_ConvertUTF8toUTF16 uriString(uri); - GeckoAppShell::MarkURIVisited(uriString); + mozilla::widget::android::GeckoAppShell::MarkURIVisited(uriString); } AppendToRecentlyVisitedURIs(aURI); @@ -215,7 +215,7 @@ nsAndroidHistory::SetURITitle(nsIURI *aURI, const nsAString& aTitle) nsresult rv = aURI->GetSpec(uri); if (NS_FAILED(rv)) return rv; NS_ConvertUTF8toUTF16 uriString(uri); - GeckoAppShell::SetURITitle(uriString, aTitle); + mozilla::widget::android::GeckoAppShell::SetURITitle(uriString, aTitle); } return NS_OK; } diff --git a/mobile/android/components/build/nsShellService.cpp b/mobile/android/components/build/nsShellService.cpp index 0c9d915c817..df24e9bdd6c 100644 --- a/mobile/android/components/build/nsShellService.cpp +++ b/mobile/android/components/build/nsShellService.cpp @@ -19,11 +19,12 @@ nsShellService::SwitchTask() } 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()) return NS_ERROR_FAILURE; - GeckoAppShell::CreateShortcut(aTitle, aURI, aIconData, aIntent); + mozilla::widget::android::GeckoAppShell::CreateShortcut(aTitle, aURI, aIconData, aIntent); return NS_OK; } diff --git a/netwerk/base/src/Tickler.cpp b/netwerk/base/src/Tickler.cpp index d9099a318d9..6ee66029c6e 100644 --- a/netwerk/base/src/Tickler.cpp +++ b/netwerk/base/src/Tickler.cpp @@ -81,7 +81,7 @@ Tickler::Init() MOZ_ASSERT(!mFD); if (AndroidBridge::HasEnv()) { - GeckoAppShell::EnableNetworkNotifications(); + mozilla::widget::android::GeckoAppShell::EnableNetworkNotifications(); } mFD = PR_OpenUDPSocket(PR_AF_INET); diff --git a/netwerk/protocol/device/CameraStreamImpl.cpp b/netwerk/protocol/device/CameraStreamImpl.cpp index 2d51be4f182..c7807a39bc2 100644 --- a/netwerk/protocol/device/CameraStreamImpl.cpp +++ b/netwerk/protocol/device/CameraStreamImpl.cpp @@ -90,7 +90,7 @@ bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera } void CameraStreamImpl::Close() { - GeckoAppShell::CloseCamera(); + mozilla::widget::android::GeckoAppShell::CloseCamera(); mCallback = nullptr; } diff --git a/netwerk/system/android/nsAndroidNetworkLinkService.cpp b/netwerk/system/android/nsAndroidNetworkLinkService.cpp index 2365d081094..97629673a94 100644 --- a/netwerk/system/android/nsAndroidNetworkLinkService.cpp +++ b/netwerk/system/android/nsAndroidNetworkLinkService.cpp @@ -33,7 +33,7 @@ nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp) return NS_OK; } - *aIsUp = GeckoAppShell::IsNetworkLinkUp(); + *aIsUp = mozilla::widget::android::GeckoAppShell::IsNetworkLinkUp(); return NS_OK; } @@ -42,7 +42,7 @@ nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown) { NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED); - *aIsKnown = GeckoAppShell::IsNetworkLinkKnown(); + *aIsKnown = mozilla::widget::android::GeckoAppShell::IsNetworkLinkKnown(); return NS_OK; } @@ -58,6 +58,6 @@ nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType) return NS_OK; } - *aLinkType = GeckoAppShell::NetworkLinkType(); + *aLinkType = mozilla::widget::android::GeckoAppShell::NetworkLinkType(); return NS_OK; } diff --git a/toolkit/components/alerts/nsAlertsService.cpp b/toolkit/components/alerts/nsAlertsService.cpp index 6ca303d3970..b8868ec2d9f 100644 --- a/toolkit/components/alerts/nsAlertsService.cpp +++ b/toolkit/components/alerts/nsAlertsService.cpp @@ -128,7 +128,7 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName, } #ifdef MOZ_WIDGET_ANDROID - GeckoAppShell::CloseNotification(aAlertName); + mozilla::widget::android::GeckoAppShell::CloseNotification(aAlertName); return NS_OK; #else @@ -149,7 +149,9 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName, const nsAString & aAlertText) { #ifdef MOZ_WIDGET_ANDROID - GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName, aProgress, aProgressMax, aAlertText); + mozilla::widget::android::GeckoAppShell::AlertsProgressListener_OnProgress(aAlertName, + aProgress, aProgressMax, + aAlertText); return NS_OK; #else return NS_ERROR_NOT_IMPLEMENTED; @@ -159,7 +161,7 @@ NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName, NS_IMETHODIMP nsAlertsService::OnCancel(const nsAString & aAlertName) { #ifdef MOZ_WIDGET_ANDROID - GeckoAppShell::CloseNotification(aAlertName); + mozilla::widget::android::GeckoAppShell::CloseNotification(aAlertName); return NS_OK; #else return NS_ERROR_NOT_IMPLEMENTED; diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 13508c7402f..590271757ae 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -2822,7 +2822,7 @@ nsDownload::SetState(DownloadState aState) if (mimeInfo) mimeInfo->GetMIMEType(contentType); - GeckoAppShell::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType)); + mozilla::widget::android::GeckoAppShell::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType)); #endif } diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index 4cf722771ef..18d74187c9e 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -230,7 +230,8 @@ typename Builder::Object BuildJavaThreadJSObject(Builder& b) b.DefineProperty(sample, "frames", frames); b.ArrayPush(samples, sample); - double sampleTime = GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId); + double sampleTime = + mozilla::widget::android::GeckoJavaSampler::GetSampleTimeJavaProfiling(0, sampleId); b.DefineProperty(sample, "time", sampleTime); } 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 (ProfileJava()) { - GeckoJavaSampler::PauseJavaProfiling(); + mozilla::widget::android::GeckoJavaSampler::PauseJavaProfiling(); typename Builder::RootedObject javaThread(b.context(), BuildJavaThreadJSObject(b)); b.ArrayPush(threads, javaThread); - GeckoJavaSampler::UnpauseJavaProfiling(); + mozilla::widget::android::GeckoJavaSampler::UnpauseJavaProfiling(); } #endif diff --git a/tools/profiler/platform.cpp b/tools/profiler/platform.cpp index c7a2e10208f..70488fb5589 100644 --- a/tools/profiler/platform.cpp +++ b/tools/profiler/platform.cpp @@ -668,7 +668,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval, if (javaInterval < 10) { aInterval = 10; } - GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000); + mozilla::widget::android::GeckoJavaSampler::StartJavaProfiling(javaInterval, 1000); } #endif diff --git a/uriloader/exthandler/android/nsAndroidHandlerApp.cpp b/uriloader/exthandler/android/nsAndroidHandlerApp.cpp index 007378e5f89..c8f6063cc4e 100644 --- a/uriloader/exthandler/android/nsAndroidHandlerApp.cpp +++ b/uriloader/exthandler/android/nsAndroidHandlerApp.cpp @@ -69,14 +69,15 @@ nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowC { nsCString 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_IMETHODIMP nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title) { - return GeckoAppShell::OpenUriExternal(data, NS_ConvertUTF8toUTF16(mMimeType), mPackageName, - mClassName, mAction) ? NS_OK : NS_ERROR_FAILURE; + return mozilla::widget::android::GeckoAppShell::OpenUriExternal(data, NS_ConvertUTF8toUTF16(mMimeType), + mPackageName, mClassName, mAction) ? NS_OK : NS_ERROR_FAILURE; } diff --git a/uriloader/exthandler/android/nsExternalSharingAppService.cpp b/uriloader/exthandler/android/nsExternalSharingAppService.cpp index 5b3e155b9f8..e7ea5288bea 100644 --- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp +++ b/uriloader/exthandler/android/nsExternalSharingAppService.cpp @@ -31,7 +31,8 @@ nsExternalSharingAppService::ShareWithDefault(const nsAString & data, { NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND"); 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 diff --git a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp index d0d2127a921..713cf7d6395 100644 --- a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp +++ b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp @@ -30,7 +30,9 @@ nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI) nsCString 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; } @@ -48,7 +50,7 @@ nsMIMEInfoAndroid::GetMimeInfoForMimeType(const nsACString& aMimeType, } nsIHandlerApp* systemDefault = nullptr; - bridge->GetHandlersForMimeType(NS_ConvertUTF8toUTF16(aMimeType), + bridge->GetHandlersForMimeType(NS_ConvertUTF8toUTF16(aMimeType), info->mHandlerApps, &systemDefault); if (systemDefault) @@ -107,7 +109,7 @@ nsMIMEInfoAndroid::GetMimeInfoForURL(const nsACString &aURL, } nsIHandlerApp* systemDefault = nullptr; - bridge->GetHandlersForURL(NS_ConvertUTF8toUTF16(aURL), + bridge->GetHandlersForURL(NS_ConvertUTF8toUTF16(aURL), mimeinfo->mHandlerApps, &systemDefault); if (systemDefault) diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index b5b3317ff1f..410c6f5fe91 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -342,7 +342,8 @@ AndroidBridge::GetHandlersForMimeType(const nsAString& aMimeType, JNIEnv *env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - jobjectArray arr = GeckoAppShell::GetHandlersForMimeTypeWrapper(aMimeType, aAction); + jobjectArray arr = + mozilla::widget::android::GeckoAppShell::GetHandlersForMimeTypeWrapper(aMimeType, aAction); if (!arr) return false; @@ -368,7 +369,7 @@ AndroidBridge::GetHandlersForURL(const nsAString& aURL, JNIEnv *env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - jobjectArray arr = GeckoAppShell::GetHandlersForURLWrapper(aURL, aAction); + jobjectArray arr = mozilla::widget::android::GeckoAppShell::GetHandlersForURLWrapper(aURL, aAction); if (!arr) return false; @@ -390,7 +391,8 @@ AndroidBridge::GetMimeTypeFromExtensions(const nsACString& aFileExt, nsCString& JNIEnv *env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - jstring jstrType = GeckoAppShell::GetMimeTypeFromExtensionsWrapper(NS_ConvertUTF8toUTF16(aFileExt)); + jstring jstrType = mozilla::widget::android::GeckoAppShell::GetMimeTypeFromExtensionsWrapper + (NS_ConvertUTF8toUTF16(aFileExt)); if (!jstrType) { return; } @@ -406,7 +408,8 @@ AndroidBridge::GetExtensionFromMimeType(const nsACString& aMimeType, nsACString& JNIEnv *env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - jstring jstrExt = GeckoAppShell::GetExtensionFromMimeTypeWrapper(NS_ConvertUTF8toUTF16(aMimeType)); + jstring jstrExt = mozilla::widget::android::GeckoAppShell::GetExtensionFromMimeTypeWrapper + (NS_ConvertUTF8toUTF16(aMimeType)); if (!jstrExt) { return; } @@ -444,7 +447,8 @@ AndroidBridge::ShowAlertNotification(const nsAString& aImageUrl, 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 @@ -456,7 +460,7 @@ AndroidBridge::GetDPI() const int DEFAULT_DPI = 160; - sDPI = GeckoAppShell::GetDpiWrapper(); + sDPI = mozilla::widget::android::GeckoAppShell::GetDpiWrapper(); if (!sDPI) { return DEFAULT_DPI; } @@ -476,14 +480,13 @@ AndroidBridge::GetScreenDepth() const int DEFAULT_DEPTH = 16; if (HasEnv()) { - sDepth = GeckoAppShell::GetScreenDepthWrapper(); + sDepth = mozilla::widget::android::GeckoAppShell::GetScreenDepthWrapper(); } if (!sDepth) return DEFAULT_DEPTH; return sDepth; } - void AndroidBridge::Vibrate(const nsTArray& aPattern) { @@ -507,7 +510,7 @@ AndroidBridge::Vibrate(const nsTArray& aPattern) ALOG_BRIDGE(" invalid vibration duration < 0"); return; } - GeckoAppShell::Vibrate1(d); + mozilla::widget::android::GeckoAppShell::Vibrate1(d); return; } @@ -533,7 +536,7 @@ AndroidBridge::Vibrate(const nsTArray& aPattern) } env->ReleaseLongArrayElements(array, elts, 0); - GeckoAppShell::VibrateA(array, -1/*don't repeat*/); + mozilla::widget::android::GeckoAppShell::VibrateA(array, -1/*don't repeat*/); } void @@ -548,7 +551,7 @@ AndroidBridge::GetSystemColors(AndroidSystemColors *aColors) AutoLocalJNIFrame jniFrame(env, 1); - jintArray arr = GeckoAppShell::GetSystemColoursWrapper(); + jintArray arr = mozilla::widget::android::GeckoAppShell::GetSystemColoursWrapper(); if (!arr) return; @@ -584,7 +587,8 @@ AndroidBridge::GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSiz 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!"); if (!arr) @@ -616,7 +620,7 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj) mLayerClient = nullptr; } - mLayerClient = GeckoLayerClient::Wrap(jobj); + mLayerClient = mozilla::widget::android::GeckoLayerClient::Wrap(jobj); if (resetting) { // 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(); 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) return false; @@ -947,7 +952,7 @@ AndroidBridge::GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInf // 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. - jdoubleArray arr = GeckoAppShell::GetCurrentBatteryInformationWrapper(); + jdoubleArray arr = mozilla::widget::android::GeckoAppShell::GetCurrentBatteryInformationWrapper(); if (!arr || env->GetArrayLength(arr) != 3) { return; } @@ -969,7 +974,7 @@ AndroidBridge::HandleGeckoMessage(const nsAString &aMessage) JNIEnv *env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - GeckoAppShell::HandleGeckoMessageWrapper(aMessage); + mozilla::widget::android::GeckoAppShell::HandleGeckoMessageWrapper(aMessage); } nsresult @@ -1027,7 +1032,7 @@ AndroidBridge::SendMessage(const nsAString& aNumber, if (!QueueSmsRequest(aRequest, &requestId)) return; - GeckoAppShell::SendMessageWrapper(aNumber, aMessage, requestId); + mozilla::widget::android::GeckoAppShell::SendMessageWrapper(aNumber, aMessage, requestId); } void @@ -1039,7 +1044,7 @@ AndroidBridge::GetMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequest if (!QueueSmsRequest(aRequest, &requestId)) return; - GeckoAppShell::GetMessageWrapper(aMessageId, requestId); + mozilla::widget::android::GeckoAppShell::GetMessageWrapper(aMessageId, requestId); } void @@ -1051,7 +1056,7 @@ AndroidBridge::DeleteMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequ if (!QueueSmsRequest(aRequest, &requestId)) return; - GeckoAppShell::DeleteMessageWrapper(aMessageId, requestId); + mozilla::widget::android::GeckoAppShell::DeleteMessageWrapper(aMessageId, requestId); } void @@ -1079,8 +1084,8 @@ AndroidBridge::CreateMessageList(const dom::mobilemessage::SmsFilterData& aFilte env->DeleteLocalRef(elem); } - GeckoAppShell::CreateMessageListWrapper(aFilter.startDate(), aFilter.endDate(), - numbers, aFilter.numbers().Length(), + mozilla::widget::android::GeckoAppShell::CreateMessageListWrapper(aFilter.startDate(), + aFilter.endDate(), numbers, aFilter.numbers().Length(), aFilter.delivery(), aReverse, requestId); } @@ -1093,7 +1098,7 @@ AndroidBridge::GetNextMessageInList(int32_t aListId, nsIMobileMessageCallback* a if (!QueueSmsRequest(aRequest, &requestId)) return; - GeckoAppShell::GetNextMessageInListWrapper(aListId, requestId); + mozilla::widget::android::GeckoAppShell::GetNextMessageInListWrapper(aListId, requestId); } bool @@ -1143,7 +1148,7 @@ AndroidBridge::GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInf // 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. - jdoubleArray arr = GeckoAppShell::GetCurrentNetworkInformationWrapper(); + jdoubleArray arr = mozilla::widget::android::GeckoAppShell::GetCurrentNetworkInformationWrapper(); if (!arr || env->GetArrayLength(arr) != 3) { return; } @@ -1329,7 +1334,7 @@ AndroidBridge::GetGlobalContextRef() { AutoLocalJNIFrame jniFrame(env, 4); - jobject context = GeckoAppShell::GetContext(); + jobject context = mozilla::widget::android::GeckoAppShell::GetContext(); if (!context) { ALOG_BRIDGE("%s: Could not GetContext()", __FUNCTION__); return 0; @@ -1380,7 +1385,7 @@ AndroidBridge::UnlockWindow(void* window) void AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLayerScale& aZoom, const CSSRect& aCssPageRect) { - GeckoLayerClient *client = mLayerClient; + mozilla::widget::android::GeckoLayerClient *client = mLayerClient; if (!client) return; @@ -1391,7 +1396,7 @@ AndroidBridge::SetFirstPaintViewport(const LayerIntPoint& aOffset, const CSSToLa void AndroidBridge::SetPageRect(const CSSRect& aCssPageRect) { - GeckoLayerClient *client = mLayerClient; + mozilla::widget::android::GeckoLayerClient *client = mLayerClient; if (!client) return; @@ -1403,7 +1408,7 @@ AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLay bool aLayersUpdated, ScreenPoint& aScrollOffset, CSSToScreenScale& aScale, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset) { - GeckoLayerClient *client = mLayerClient; + mozilla::widget::android::GeckoLayerClient *client = mLayerClient; if (!client) { ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__); return; @@ -1434,7 +1439,7 @@ void AndroidBridge::SyncFrameMetrics(const ScreenPoint& aScrollOffset, float aZo bool aLayersUpdated, const CSSRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution, bool aIsFirstPaint, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset) { - GeckoLayerClient *client = mLayerClient; + mozilla::widget::android::GeckoLayerClient *client = mLayerClient; if (!client) { ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__); return; @@ -1542,7 +1547,7 @@ AndroidBridge::GetScreenOrientation() { ALOG_BRIDGE("AndroidBridge::GetScreenOrientation"); - int16_t orientation = GeckoAppShell::GetScreenOrientationWrapper(); + int16_t orientation = mozilla::widget::android::GeckoAppShell::GetScreenOrientationWrapper(); if (!orientation) return dom::eScreenOrientation_None; @@ -1569,10 +1574,11 @@ AndroidBridge::GetProxyForURI(const nsACString & aSpec, JNIEnv* env = GetJNIEnv(); AutoLocalJNIFrame jniFrame(env, 1); - jstring jstrRet = GeckoAppShell::GetProxyForURIWrapper(NS_ConvertUTF8toUTF16(aSpec), - NS_ConvertUTF8toUTF16(aScheme), - NS_ConvertUTF8toUTF16(aHost), - aPort); + jstring jstrRet = + mozilla::widget::android::GeckoAppShell::GetProxyForURIWrapper(NS_ConvertUTF8toUTF16(aSpec), + NS_ConvertUTF8toUTF16(aScheme), + NS_ConvertUTF8toUTF16(aHost), + aPort); if (!jstrRet) return NS_ERROR_FAILURE; @@ -1605,7 +1611,8 @@ AndroidBridge::AddPluginView(jobject view, const LayoutDeviceRect& rect, bool is return; 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" @@ -1620,7 +1627,8 @@ AndroidBridge::GetThreadNameJavaProfiling(uint32_t aThreadId, nsCString & aResul AutoLocalJNIFrame jniFrame(env, 1); - jstring jstrThreadName = GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(aThreadId); + jstring jstrThreadName = + mozilla::widget::android::GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(aThreadId); if (!jstrThreadName) return false; @@ -1638,7 +1646,8 @@ AndroidBridge::GetFrameNameJavaProfiling(uint32_t aThreadId, uint32_t aSampleId, AutoLocalJNIFrame jniFrame(env, 1); - jstring jstrSampleName = GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(aThreadId, aSampleId, aFrameId); + jstring jstrSampleName = mozilla::widget::android::GeckoJavaSampler::GetFrameNameJavaProfilingWrapper + (aThreadId, aSampleId, aFrameId); if (!jstrSampleName) return false; @@ -1836,7 +1845,7 @@ AndroidBridge::IsContentDocumentDisplayed() bool 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) { ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__); return false; @@ -1866,11 +1875,11 @@ AndroidBridge::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const return ret; } -NativePanZoomController* +mozilla::widget::android::NativePanZoomController* AndroidBridge::SetNativePanZoomController(jobject obj) { - NativePanZoomController* old = mNativePanZoomController; - mNativePanZoomController = NativePanZoomController::Wrap(obj); + mozilla::widget::android::NativePanZoomController* old = mNativePanZoomController; + mNativePanZoomController = mozilla::widget::android::NativePanZoomController::Wrap(obj); return old; } @@ -1897,7 +1906,7 @@ AndroidBridge::HandleDoubleTap(const CSSPoint& aPoint, int32_t aModifiers, 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( NS_LITERAL_CSTRING("Gesture:DoubleTap"), data)); } @@ -1908,7 +1917,7 @@ AndroidBridge::HandleSingleTap(const CSSPoint& aPoint, const mozilla::layers::ScrollableLayerGuid& aGuid) { // 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( NS_LITERAL_CSTRING("Gesture:SingleTap"), data)); } @@ -1918,7 +1927,7 @@ AndroidBridge::HandleLongTap(const CSSPoint& aPoint, int32_t aModifiers, 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( NS_LITERAL_CSTRING("Gesture:LongPress"), data)); } diff --git a/widget/android/AndroidBridge.h b/widget/android/AndroidBridge.h index 501a4240258..4154b58f5ec 100644 --- a/widget/android/AndroidBridge.h +++ b/widget/android/AndroidBridge.h @@ -48,8 +48,6 @@ class Thread; typedef void* EGLSurface; -using namespace mozilla::widget::android; - namespace mozilla { namespace hal { @@ -181,7 +179,7 @@ public: jthrowable e = aEnv->ExceptionOccurred(); MOZ_ASSERT(e); aEnv->ExceptionClear(); - GeckoAppShell::HandleUncaughtException(nullptr, e); + mozilla::widget::android::GeckoAppShell::HandleUncaughtException(nullptr, e); // Should be dead by now... MOZ_CRASH("Failed to handle uncaught exception"); } @@ -202,10 +200,10 @@ public: void ContentDocumentChanged(); 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); - GeckoLayerClient* GetLayerClient() { return mLayerClient; } + mozilla::widget::android::GeckoLayerClient* GetLayerClient() { return mLayerClient; } bool GetHandlersForURL(const nsAString& aURL, nsIMutableArray* handlersArray = nullptr, @@ -356,7 +354,7 @@ protected: JNIEnv *mJNIEnv; pthread_t mThread; - GeckoLayerClient *mLayerClient; + mozilla::widget::android::GeckoLayerClient *mLayerClient; // the android.telephony.SmsMessage class jclass mAndroidSmsMessageClass; @@ -397,7 +395,7 @@ protected: jclass jLayerView; jfieldID jEGLSurfacePointerField; - GLController *mGLControllerObj; + mozilla::widget::android::GLController *mGLControllerObj; // some convinient types to have around jclass jStringClass; @@ -421,14 +419,14 @@ protected: void (* Region_set)(void* region, void* rect); private: - NativePanZoomController* mNativePanZoomController; + mozilla::widget::android::NativePanZoomController* mNativePanZoomController; // 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 // to touch it nsTArray mDelayedTaskQueue; public: - NativePanZoomController* SetNativePanZoomController(jobject obj); + mozilla::widget::android::NativePanZoomController* SetNativePanZoomController(jobject obj); // GeckoContentController methods void RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE; void AcknowledgeScrollUpdate(const mozilla::layers::FrameMetrics::ViewID& aScrollId, diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp index c92705785b3..9dd1805e561 100644 --- a/widget/android/AndroidJNI.cpp +++ b/widget/android/AndroidJNI.cpp @@ -47,6 +47,7 @@ using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::dom::mobilemessage; using namespace mozilla::layers; +using namespace mozilla::widget::android; /* Forward declare all the JNI methods as extern "C" */ diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index b22177e26ed..f51a5ff5c44 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -82,20 +82,20 @@ public: nsCOMPtr tab; mBrowserApp->GetBrowserTab(mTabId, getter_AddRefs(tab)); if (!tab) { - ThumbnailHelper::SendThumbnail(buffer, mTabId, false); + mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, false); return NS_ERROR_FAILURE; } tab->GetWindow(getter_AddRefs(domWindow)); if (!domWindow) { - ThumbnailHelper::SendThumbnail(buffer, mTabId, false); + mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, false); return NS_ERROR_FAILURE; } 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); - ThumbnailHelper::SendThumbnail(buffer, mTabId, NS_SUCCEEDED(rv)); + mozilla::widget::android::ThumbnailHelper::SendThumbnail(buffer, mTabId, NS_SUCCEEDED(rv)); return rv; } private: @@ -110,7 +110,7 @@ class WakeLockListener MOZ_FINAL : public nsIDOMMozWakeLockListener { NS_DECL_ISUPPORTS; nsresult Callback(const nsAString& topic, const nsAString& state) { - GeckoAppShell::NotifyWakeLockChanged(topic, state); + mozilla::widget::android::GeckoAppShell::NotifyWakeLockChanged(topic, state); return NS_OK; } }; @@ -268,7 +268,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) // in w3c spec case hal::SENSOR_ORIENTATION: values.AppendElement(360 -curEvent->X()); - values.AppendElement(-curEvent->Y()); + values.AppendElement(-curEvent->Y()); values.AppendElement(-curEvent->Z()); break; case hal::SENSOR_LINEAR_ACCELERATION: @@ -276,7 +276,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) case hal::SENSOR_GYROSCOPE: case hal::SENSOR_PROXIMITY: values.AppendElement(curEvent->X()); - values.AppendElement(curEvent->Y()); + values.AppendElement(curEvent->Y()); values.AppendElement(curEvent->Z()); break; @@ -599,7 +599,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) } if (curEvent->AckNeeded()) { - GeckoAppShell::AcknowledgeEvent(); + mozilla::widget::android::GeckoAppShell::AcknowledgeEvent(); } EVLOG("nsAppShell: -- done event %p %d", (void*)curEvent.get(), curEvent->Type()); diff --git a/widget/android/nsClipboard.cpp b/widget/android/nsClipboard.cpp index 617bfa743b6..eac772481a9 100644 --- a/widget/android/nsClipboard.cpp +++ b/widget/android/nsClipboard.cpp @@ -43,8 +43,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsAutoString buffer; supportsString->GetData(buffer); - Clipboard::SetClipboardText(buffer); - + mozilla::widget::android::Clipboard::SetClipboardText(buffer); return NS_OK; } @@ -85,8 +84,8 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard) { if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED; - Clipboard::ClearText(); - + mozilla::widget::android::Clipboard::ClearText(); + return NS_OK; } @@ -98,7 +97,7 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, *aHasText = false; if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED; - *aHasText = Clipboard::HasText(); + *aHasText = mozilla::widget::android::Clipboard::HasText(); return NS_OK; } diff --git a/widget/android/nsIMEPicker.cpp b/widget/android/nsIMEPicker.cpp index ac7f58f5d49..098bf331e93 100644 --- a/widget/android/nsIMEPicker.cpp +++ b/widget/android/nsIMEPicker.cpp @@ -22,6 +22,6 @@ nsIMEPicker::~nsIMEPicker() /* void show (); */ NS_IMETHODIMP nsIMEPicker::Show() { - GeckoAppShell::ShowInputMethodPicker(); + mozilla::widget::android::GeckoAppShell::ShowInputMethodPicker(); return NS_OK; } diff --git a/widget/android/nsLookAndFeel.cpp b/widget/android/nsLookAndFeel.cpp index 851dc16a589..2e77f465f11 100644 --- a/widget/android/nsLookAndFeel.cpp +++ b/widget/android/nsLookAndFeel.cpp @@ -470,7 +470,7 @@ nsLookAndFeel::GetEchoPasswordImpl() { if (!mInitializedShowPassword) { if (XRE_GetProcessType() == GeckoProcessType_Default) { - mShowPassword = GeckoAppShell::GetShowPasswordSetting(); + mShowPassword = mozilla::widget::android::GeckoAppShell::GetShowPasswordSetting(); } else { ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword); } diff --git a/widget/android/nsScreenManagerAndroid.cpp b/widget/android/nsScreenManagerAndroid.cpp index b892e5be8b6..cbc83eb2af2 100644 --- a/widget/android/nsScreenManagerAndroid.cpp +++ b/widget/android/nsScreenManagerAndroid.cpp @@ -59,7 +59,7 @@ nsScreenAndroid::GetColorDepth(int32_t *aColorDepth) void nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness) { - GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL); + mozilla::widget::android::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL); } NS_IMPL_ISUPPORTS1(nsScreenManagerAndroid, nsIScreenManager) diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 9a7a41d1b51..0d50d715beb 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -352,7 +352,7 @@ nsWindow::GetDefaultScaleInternal() return density; } - density = GeckoAppShell::GetDensity(); + density = mozilla::widget::android::GeckoAppShell::GetDensity(); if (!density) { density = 1.0; @@ -514,7 +514,7 @@ nsWindow::SetSizeMode(int32_t aMode) { switch (aMode) { case nsSizeMode_Minimized: - GeckoAppShell::MoveTaskToBack(); + mozilla::widget::android::GeckoAppShell::MoveTaskToBack(); break; case nsSizeMode_Fullscreen: MakeFullScreen(true); @@ -692,7 +692,7 @@ nsWindow::DispatchEvent(WidgetGUIEvent* aEvent) NS_IMETHODIMP nsWindow::MakeFullScreen(bool aFullScreen) { - GeckoAppShell::SetFullScreen(aFullScreen); + mozilla::widget::android::GeckoAppShell::SetFullScreen(aFullScreen); 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 // previous block should not be default-prevented bool defaultPrevented = isDownEvent ? false : preventDefaultActions; - GeckoAppShell::NotifyDefaultPrevented(defaultPrevented); + mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(defaultPrevented); sDefaultPreventedNotified = true; } @@ -1202,7 +1202,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae) // for the next event. if (isDownEvent) { if (preventDefaultActions) { - GeckoAppShell::NotifyDefaultPrevented(true); + mozilla::widget::android::GeckoAppShell::NotifyDefaultPrevented(true); sDefaultPreventedNotified = true; } else { sDefaultPreventedNotified = false; @@ -1838,10 +1838,10 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae) NotifyIMEOfTextChange(notification); FlushIMEChanges(); } - GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); + mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); return; } else if (ae->Action() == AndroidGeckoEvent::IME_UPDATE_CONTEXT) { - GeckoAppShell::NotifyIMEContext(mInputContext.mIMEState.mEnabled, + mozilla::widget::android::GeckoAppShell::NotifyIMEContext(mInputContext.mIMEState.mEnabled, mInputContext.mHTMLInputType, mInputContext.mHTMLInputInputmode, mInputContext.mActionHint); @@ -1852,7 +1852,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae) // Still reply to events, but don't do anything else if (ae->Action() == AndroidGeckoEvent::IME_SYNCHRONIZE || ae->Action() == AndroidGeckoEvent::IME_REPLACE_TEXT) { - GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); + mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); } return; } @@ -1865,7 +1865,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae) case AndroidGeckoEvent::IME_SYNCHRONIZE: { FlushIMEChanges(); - GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); + mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); } break; case AndroidGeckoEvent::IME_REPLACE_TEXT: @@ -1897,7 +1897,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae) } mIMEKeyEvents.Clear(); FlushIMEChanges(); - GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); + mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); break; } @@ -1925,7 +1925,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae) DispatchEvent(&event); } FlushIMEChanges(); - GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); + mozilla::widget::android::GeckoAppShell::NotifyIME(AndroidBridge::NOTIFY_IME_REPLY_EVENT); } break; case AndroidGeckoEvent::IME_SET_SELECTION: @@ -2114,7 +2114,7 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification) case REQUEST_TO_COMMIT_COMPOSITION: //ALOGIME("IME: REQUEST_TO_COMMIT_COMPOSITION: s=%d", aState); RemoveIMEComposition(); - GeckoAppShell::NotifyIME(REQUEST_TO_COMMIT_COMPOSITION); + mozilla::widget::android::GeckoAppShell::NotifyIME(REQUEST_TO_COMMIT_COMPOSITION); return NS_OK; case REQUEST_TO_CANCEL_COMPOSITION: ALOGIME("IME: REQUEST_TO_CANCEL_COMPOSITION"); @@ -2138,11 +2138,11 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification) DispatchEvent(&compEvent); } - GeckoAppShell::NotifyIME(REQUEST_TO_CANCEL_COMPOSITION); + mozilla::widget::android::GeckoAppShell::NotifyIME(REQUEST_TO_CANCEL_COMPOSITION); return NS_OK; case 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; case NOTIFY_IME_OF_BLUR: ALOGIME("IME: NOTIFY_IME_OF_BLUR"); @@ -2154,7 +2154,7 @@ nsWindow::NotifyIME(const IMENotification& aIMENotification) mIMEComposing = false; mIMEComposingText.Truncate(); - GeckoAppShell::NotifyIME(NOTIFY_IME_OF_BLUR); + mozilla::widget::android::GeckoAppShell::NotifyIME(NOTIFY_IME_OF_BLUR); return NS_OK; case NOTIFY_IME_OF_SELECTION_CHANGE: if (mIMEMaskSelectionUpdate) { @@ -2216,7 +2216,7 @@ nsWindow::SetInputContext(const InputContext& aContext, if (enabled == IMEState::ENABLED && aAction.UserMightRequestOpenVKB()) { // 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; } @@ -2272,7 +2272,7 @@ nsWindow::FlushIMEChanges() if (!event.mSucceeded) return; - GeckoAppShell::NotifyIMEChange(event.mReply.mString, + mozilla::widget::android::GeckoAppShell::NotifyIMEChange(event.mReply.mString, change.mStart, change.mOldEnd, change.mNewEnd); @@ -2287,7 +2287,7 @@ nsWindow::FlushIMEChanges() if (!event.mSucceeded) return; - GeckoAppShell::NotifyIMEChange(EmptyString(), + mozilla::widget::android::GeckoAppShell::NotifyIMEChange(EmptyString(), (int32_t) event.GetSelectionStart(), (int32_t) event.GetSelectionEnd(), -1); mIMESelectionChanged = false; @@ -2389,7 +2389,7 @@ nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) AutoLocalJNIFrame jniFrame(env); - GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient(); + mozilla::widget::android::GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient(); if (!client || client->isNull()) { ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__); return; @@ -2428,7 +2428,7 @@ nsWindow::DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) NS_ABORT_IF_FALSE(!mLayerRendererFrame.isNull(), "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(aManager->GetCompositor())->gl(); gl::ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST); diff --git a/widget/windows/winrt/ToastNotificationHandler.cpp b/widget/windows/winrt/ToastNotificationHandler.cpp index 8e4b0ec724f..1466cfef49f 100644 --- a/widget/windows/winrt/ToastNotificationHandler.cpp +++ b/widget/windows/winrt/ToastNotificationHandler.cpp @@ -27,9 +27,10 @@ ToastNotificationHandler::DisplayNotification(HSTRING title, { mCookie = aCookie; - ComPtr toastXml = InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastImageAndText03); - ComPtr toastTextElements, toastImageElements; - ComPtr titleTextNodeRoot, msgTextNodeRoot, imageNodeRoot, srcAttribute; + Microsoft::WRL::ComPtr toastXml = + InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastImageAndText03); + Microsoft::WRL::ComPtr toastTextElements, toastImageElements; + Microsoft::WRL::ComPtr titleTextNodeRoot, msgTextNodeRoot, imageNodeRoot, srcAttribute; HSTRING textNodeStr, imageNodeStr, srcNodeStr; HSTRING_HEADER textHeader, imageHeader, srcHeader; @@ -43,7 +44,7 @@ ToastNotificationHandler::DisplayNotification(HSTRING title, AssertRetHRESULT(toastTextElements->Item(1, &msgTextNodeRoot), false); AssertRetHRESULT(toastImageElements->Item(0, &imageNodeRoot), false); - ComPtr attributes; + Microsoft::WRL::ComPtr attributes; AssertRetHRESULT(imageNodeRoot->get_Attributes(&attributes), false); AssertRetHRESULT(attributes->GetNamedItem(srcNodeStr, &srcAttribute), false); @@ -62,9 +63,10 @@ ToastNotificationHandler::DisplayTextNotification(HSTRING title, { mCookie = aCookie; - ComPtr toastXml = InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastText03); - ComPtr toastTextElements; - ComPtr titleTextNodeRoot, msgTextNodeRoot; + Microsoft::WRL::ComPtr toastXml = + InitializeXmlForTemplate(ToastTemplateType::ToastTemplateType_ToastText03); + Microsoft::WRL::ComPtr toastTextElements; + Microsoft::WRL::ComPtr titleTextNodeRoot, msgTextNodeRoot; HSTRING textNodeStr; HSTRING_HEADER textHeader; @@ -80,9 +82,9 @@ ToastNotificationHandler::DisplayTextNotification(HSTRING title, return CreateWindowsNotificationFromXml(toastXml.Get(), aAppId); } -ComPtr +Microsoft::WRL::ComPtr ToastNotificationHandler::InitializeXmlForTemplate(ToastTemplateType templateType) { - ComPtr toastXml; + Microsoft::WRL::ComPtr toastXml; AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), mToastNotificationManagerStatics.GetAddressOf()), nullptr); @@ -96,8 +98,8 @@ bool ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXml, const nsAString& aAppId) { - ComPtr notification; - ComPtr factory; + Microsoft::WRL::ComPtr notification; + Microsoft::WRL::ComPtr factory; AssertRetHRESULT(GetActivationFactory(HStringReference(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(), factory.GetAddressOf()), false); AssertRetHRESULT(factory->CreateToastNotification(toastXml, ¬ification), @@ -110,7 +112,7 @@ ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXm AssertRetHRESULT(notification->add_Dismissed(Callback(this, &ToastNotificationHandler::OnDismiss).Get(), &dismissedToken), false); - ComPtr notifier; + Microsoft::WRL::ComPtr notifier; if (aAppId.IsEmpty()) { AssertRetHRESULT(mToastNotificationManagerStatics->CreateToastNotifier( ¬ifier), false); @@ -126,9 +128,10 @@ ToastNotificationHandler::CreateWindowsNotificationFromXml(IXmlDocument *toastXm return true; } -void ToastNotificationHandler::SetNodeValueString(HSTRING inputString, ComPtr node, ComPtr xml) { - ComPtr inputText; - ComPtr inputTextNode, pAppendedChild; +void ToastNotificationHandler::SetNodeValueString(HSTRING inputString, + Microsoft::WRL::ComPtr node, Microsoft::WRL::ComPtr xml) { + Microsoft::WRL::ComPtr inputText; + Microsoft::WRL::ComPtr inputTextNode, pAppendedChild; AssertHRESULT(xml->CreateTextNode(inputString, &inputText)); AssertHRESULT(inputText.As(&inputTextNode)); diff --git a/widget/windows/winrt/ToastNotificationHandler.h b/widget/windows/winrt/ToastNotificationHandler.h index a0b8c729079..4935f8d4a06 100644 --- a/widget/windows/winrt/ToastNotificationHandler.h +++ b/widget/windows/winrt/ToastNotificationHandler.h @@ -10,7 +10,6 @@ #include "mozwrlbase.h" #include "nsString.h" -using namespace Microsoft::WRL; class ToastNotificationHandler { 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::IXmlDocument IXmlDocument; - void SetNodeValueString(HSTRING inputString, ComPtr node, ComPtr xml); + void SetNodeValueString(HSTRING inputString,Microsoft::WRL::ComPtr node, + Microsoft::WRL::ComPtr xml); public: ToastNotificationHandler() {}; ~ToastNotificationHandler() {}; @@ -36,9 +36,9 @@ class ToastNotificationHandler { private: nsString mCookie; - ComPtr mToastNotificationManagerStatics; + Microsoft::WRL::ComPtr mToastNotificationManagerStatics; bool CreateWindowsNotificationFromXml(IXmlDocument *toastXml, const nsAString& aAppId); - ComPtr InitializeXmlForTemplate(ToastTemplateType templateType); + Microsoft::WRL::ComPtr InitializeXmlForTemplate(ToastTemplateType templateType); }; diff --git a/widget/windows/winrt/UIABridgePrivate.h b/widget/windows/winrt/UIABridgePrivate.h index 7f2c02e0fc1..41256cbb616 100644 --- a/widget/windows/winrt/UIABridgePrivate.h +++ b/widget/windows/winrt/UIABridgePrivate.h @@ -24,11 +24,10 @@ namespace mozilla { namespace widget { namespace winrt { -using namespace Microsoft::WRL; - // represents the root window to UIA [uuid("D3EDD951-0715-4501-A8E5-25D97EF35D5A")] -class UIABridge : public RuntimeClass, +class UIABridge : public Microsoft::WRL::RuntimeClass, IUIABridge, IUIAElement, IRawElementProviderSimple, @@ -81,7 +80,8 @@ private: }; [uuid("4438135F-F624-43DE-A417-275CE7A1A0CD")] -class UIATextElement : public RuntimeClass, +class UIATextElement : public Microsoft::WRL::RuntimeClass, IUIAElement, IRawElementProviderSimple, IRawElementProviderFragment, diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index 5d8a0b6cfaf..fddb7ff1477 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -267,7 +267,7 @@ nsSystemInfo::Init() android_sdk_version = version; if (version >= 8 && mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "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); // 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. diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 95b3fb1514f..a54f374ba18 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -1898,7 +1898,8 @@ nsLocalFile::Launch() rv = mimeService->GetTypeFromFile(this, type); 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) CFURLRef url; if (NS_SUCCEEDED(GetCFURL(&url))) {