@@ -36,13 +36,13 @@ NS_IMPL_RELEASE_INHERITED(ScreenOrientation, DOMEventTargetHelper)
3636static OrientationType InternalOrientationToType(
3737 hal::ScreenOrientation aOrientation) {
3838 switch (aOrientation) {
39- case hal::eScreenOrientation_PortraitPrimary :
39+ case hal::ScreenOrientation::PortraitPrimary :
4040 return OrientationType::Portrait_primary;
41- case hal::eScreenOrientation_PortraitSecondary :
41+ case hal::ScreenOrientation::PortraitSecondary :
4242 return OrientationType::Portrait_secondary;
43- case hal::eScreenOrientation_LandscapePrimary :
43+ case hal::ScreenOrientation::LandscapePrimary :
4444 return OrientationType::Landscape_primary;
45- case hal::eScreenOrientation_LandscapeSecondary :
45+ case hal::ScreenOrientation::LandscapeSecondary :
4646 return OrientationType::Landscape_secondary;
4747 default :
4848 MOZ_CRASH (" Bad aOrientation value" );
@@ -53,13 +53,13 @@ static hal::ScreenOrientation OrientationTypeToInternal(
5353 OrientationType aOrientation) {
5454 switch (aOrientation) {
5555 case OrientationType::Portrait_primary:
56- return hal::eScreenOrientation_PortraitPrimary ;
56+ return hal::ScreenOrientation::PortraitPrimary ;
5757 case OrientationType::Portrait_secondary:
58- return hal::eScreenOrientation_PortraitSecondary ;
58+ return hal::ScreenOrientation::PortraitSecondary ;
5959 case OrientationType::Landscape_primary:
60- return hal::eScreenOrientation_LandscapePrimary ;
60+ return hal::ScreenOrientation::LandscapePrimary ;
6161 case OrientationType::Landscape_secondary:
62- return hal::eScreenOrientation_LandscapeSecondary ;
62+ return hal::ScreenOrientation::LandscapeSecondary ;
6363 default :
6464 MOZ_CRASH (" Bad aOrientation value" );
6565 }
@@ -154,7 +154,7 @@ ScreenOrientation::LockOrientationTask::~LockOrientationTask() = default;
154154
155155bool ScreenOrientation::LockOrientationTask::OrientationLockContains (
156156 OrientationType aOrientationType) {
157- return mOrientationLock & OrientationTypeToInternal (aOrientationType);
157+ return bool ( mOrientationLock & OrientationTypeToInternal (aOrientationType) );
158158}
159159
160160NS_IMETHODIMP
@@ -179,7 +179,7 @@ ScreenOrientation::LockOrientationTask::Run() {
179179 return NS_OK;
180180 }
181181
182- if (mOrientationLock == hal::eScreenOrientation_None ) {
182+ if (mOrientationLock == hal::ScreenOrientation::None ) {
183183 mScreenOrientation ->UnlockDeviceOrientation ();
184184 mPromise ->MaybeResolveWithUndefined ();
185185 mDocument ->ClearOrientationPendingPromise ();
@@ -211,7 +211,7 @@ ScreenOrientation::LockOrientationTask::Run() {
211211
212212 BrowsingContext* bc = mDocument ->GetBrowsingContext ();
213213 if (OrientationLockContains (bc->GetCurrentOrientationType ()) ||
214- (mOrientationLock == hal::eScreenOrientation_Default &&
214+ (mOrientationLock == hal::ScreenOrientation::Default &&
215215 bc->GetCurrentOrientationAngle () == 0 )) {
216216 // Orientation lock will not cause an orientation change.
217217 mPromise ->MaybeResolveWithUndefined ();
@@ -223,37 +223,37 @@ ScreenOrientation::LockOrientationTask::Run() {
223223
224224already_AddRefed<Promise> ScreenOrientation::Lock (
225225 OrientationLockType aOrientation, ErrorResult& aRv) {
226- hal::ScreenOrientation orientation = hal::eScreenOrientation_None ;
226+ hal::ScreenOrientation orientation = hal::ScreenOrientation::None ;
227227
228228 switch (aOrientation) {
229229 case OrientationLockType::Any:
230- orientation = hal::eScreenOrientation_PortraitPrimary |
231- hal::eScreenOrientation_PortraitSecondary |
232- hal::eScreenOrientation_LandscapePrimary |
233- hal::eScreenOrientation_LandscapeSecondary ;
230+ orientation = hal::ScreenOrientation::PortraitPrimary |
231+ hal::ScreenOrientation::PortraitSecondary |
232+ hal::ScreenOrientation::LandscapePrimary |
233+ hal::ScreenOrientation::LandscapeSecondary ;
234234 break ;
235235 case OrientationLockType::Natural:
236- orientation |= hal::eScreenOrientation_Default ;
236+ orientation |= hal::ScreenOrientation::Default ;
237237 break ;
238238 case OrientationLockType::Landscape:
239- orientation = hal::eScreenOrientation_LandscapePrimary |
240- hal::eScreenOrientation_LandscapeSecondary ;
239+ orientation = hal::ScreenOrientation::LandscapePrimary |
240+ hal::ScreenOrientation::LandscapeSecondary ;
241241 break ;
242242 case OrientationLockType::Portrait:
243- orientation = hal::eScreenOrientation_PortraitPrimary |
244- hal::eScreenOrientation_PortraitSecondary ;
243+ orientation = hal::ScreenOrientation::PortraitPrimary |
244+ hal::ScreenOrientation::PortraitSecondary ;
245245 break ;
246246 case OrientationLockType::Portrait_primary:
247- orientation = hal::eScreenOrientation_PortraitPrimary ;
247+ orientation = hal::ScreenOrientation::PortraitPrimary ;
248248 break ;
249249 case OrientationLockType::Portrait_secondary:
250- orientation = hal::eScreenOrientation_PortraitSecondary ;
250+ orientation = hal::ScreenOrientation::PortraitSecondary ;
251251 break ;
252252 case OrientationLockType::Landscape_primary:
253- orientation = hal::eScreenOrientation_LandscapePrimary ;
253+ orientation = hal::ScreenOrientation::LandscapePrimary ;
254254 break ;
255255 case OrientationLockType::Landscape_secondary:
256- orientation = hal::eScreenOrientation_LandscapeSecondary ;
256+ orientation = hal::ScreenOrientation::LandscapeSecondary ;
257257 break ;
258258 default :
259259 NS_WARNING (" Unexpected orientation type" );
@@ -401,7 +401,7 @@ RefPtr<MozPromise<bool, bool, false>> ScreenOrientation::LockDeviceOrientation(
401401}
402402
403403void ScreenOrientation::Unlock (ErrorResult& aRv) {
404- RefPtr<Promise> p = LockInternal (hal::eScreenOrientation_None , aRv);
404+ RefPtr<Promise> p = LockInternal (hal::ScreenOrientation::None , aRv);
405405}
406406
407407void ScreenOrientation::UnlockDeviceOrientation () {
@@ -517,10 +517,10 @@ void ScreenOrientation::Notify(const hal::ScreenConfiguration& aConfiguration) {
517517 }
518518
519519 hal::ScreenOrientation orientation = aConfiguration.orientation ();
520- if (orientation != hal::eScreenOrientation_PortraitPrimary &&
521- orientation != hal::eScreenOrientation_PortraitSecondary &&
522- orientation != hal::eScreenOrientation_LandscapePrimary &&
523- orientation != hal::eScreenOrientation_LandscapeSecondary ) {
520+ if (orientation != hal::ScreenOrientation::PortraitPrimary &&
521+ orientation != hal::ScreenOrientation::PortraitSecondary &&
522+ orientation != hal::ScreenOrientation::LandscapePrimary &&
523+ orientation != hal::ScreenOrientation::LandscapeSecondary ) {
524524 // The platform may notify of some other values from
525525 // an orientation lock, but we only care about real
526526 // changes to screen orientation which result in one of
@@ -559,7 +559,7 @@ void ScreenOrientation::Notify(const hal::ScreenConfiguration& aConfiguration) {
559559
560560void ScreenOrientation::UpdateActiveOrientationLock (
561561 hal::ScreenOrientation aOrientation) {
562- if (aOrientation == hal::eScreenOrientation_None ) {
562+ if (aOrientation == hal::ScreenOrientation::None ) {
563563 hal::UnlockScreenOrientation ();
564564 } else {
565565 hal::LockScreenOrientation (aOrientation)
0 commit comments