forked from mirrors/gecko-dev
Bug 1357774 - Part 1: Add a 'SetCurrentRDMPaneOrientation' WebIDL extension on the Document r=bradwerth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D29455 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e7d0893a1f
commit
f697388960
4 changed files with 19 additions and 7 deletions
|
|
@ -1975,6 +1975,12 @@ class Document : public nsINode,
|
|||
return mOrientationPendingPromise;
|
||||
}
|
||||
|
||||
void SetRDMPaneOrientation(OrientationType aType, uint16_t aAngle) {
|
||||
if (mInRDMPane) {
|
||||
SetCurrentOrientation(aType, aAngle);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// Document notification API's
|
||||
|
|
|
|||
|
|
@ -584,4 +584,8 @@ partial interface Document {
|
|||
// is not propegated to descendant Documents upon settting.
|
||||
[ChromeOnly]
|
||||
attribute boolean inRDMPane;
|
||||
// Extension to give chrome JS the ability to set the window screen
|
||||
// orientation while in RDM.
|
||||
[ChromeOnly]
|
||||
void setRDMPaneOrientation(OrientationType type, float rotationAngle);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
|
|||
|
||||
int32_t colorDepth, pixelDepth;
|
||||
int16_t angle;
|
||||
ScreenOrientation orientation;
|
||||
hal::ScreenOrientation orientation;
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
|
||||
int32_t rectX, rectY, rectWidth, rectHeight;
|
||||
|
|
@ -113,7 +113,8 @@ void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
|
|||
screen->GetRect(&rectX, &rectY, &rectWidth, &rectHeight);
|
||||
screen->GetColorDepth(&colorDepth);
|
||||
screen->GetPixelDepth(&pixelDepth);
|
||||
orientation = static_cast<ScreenOrientation>(bridge->GetScreenOrientation());
|
||||
orientation =
|
||||
static_cast<hal::ScreenOrientation>(bridge->GetScreenOrientation());
|
||||
angle = bridge->GetScreenAngle();
|
||||
|
||||
*aScreenConfiguration =
|
||||
|
|
@ -121,11 +122,12 @@ void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
|
|||
orientation, angle, colorDepth, pixelDepth);
|
||||
}
|
||||
|
||||
bool LockScreenOrientation(const ScreenOrientation& aOrientation) {
|
||||
bool LockScreenOrientation(const hal::ScreenOrientation& aOrientation) {
|
||||
// Force the default orientation to be portrait-primary.
|
||||
ScreenOrientation orientation = aOrientation == eScreenOrientation_Default
|
||||
? eScreenOrientation_PortraitPrimary
|
||||
: aOrientation;
|
||||
hal::ScreenOrientation orientation =
|
||||
aOrientation == eScreenOrientation_Default
|
||||
? eScreenOrientation_PortraitPrimary
|
||||
: aOrientation;
|
||||
|
||||
switch (orientation) {
|
||||
// The Android backend only supports these orientations.
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
|
|||
fallback::GetCurrentScreenConfiguration(aScreenConfiguration);
|
||||
}
|
||||
|
||||
bool LockScreenOrientation(const ScreenOrientation& aOrientation) {
|
||||
bool LockScreenOrientation(const hal::ScreenOrientation& aOrientation) {
|
||||
bool allowed;
|
||||
Hal()->SendLockScreenOrientation(aOrientation, &allowed);
|
||||
return allowed;
|
||||
|
|
|
|||
Loading…
Reference in a new issue