mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 740192 - Screen orientation needs a specific security model for installed web apps. r=jlebar
This commit is contained in:
parent
16367bdebc
commit
bbecbc0081
@ -45,6 +45,7 @@
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -381,11 +382,15 @@ nsScreen::MozLockOrientation(const nsAString& aOrientation, bool* aReturn)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool fullscreen;
|
||||
doc->GetMozFullScreen(&fullscreen);
|
||||
if (!fullscreen) {
|
||||
*aReturn = false;
|
||||
return NS_OK;
|
||||
// Apps and frames contained in apps can lock orientation.
|
||||
// But non-apps can lock orientation only if they're fullscreen.
|
||||
if (!static_cast<nsGlobalWindow*>(GetOwner())->IsPartOfApp()) {
|
||||
bool fullscreen;
|
||||
doc->GetMozFullScreen(&fullscreen);
|
||||
if (!fullscreen) {
|
||||
*aReturn = false;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
|
||||
|
Loading…
Reference in New Issue
Block a user