mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Backed out changeset 1e13c9c09273 (bug 1105827)
CLOSED TREE
This commit is contained in:
parent
e0592c3416
commit
9067fe58d8
@ -1,29 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#include "PermissionUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
PermissionState
|
||||
ActionToPermissionState(uint32_t aAction)
|
||||
{
|
||||
switch (aAction) {
|
||||
case nsIPermissionManager::ALLOW_ACTION:
|
||||
return PermissionState::Granted;
|
||||
|
||||
case nsIPermissionManager::DENY_ACTION:
|
||||
return PermissionState::Denied;
|
||||
|
||||
default:
|
||||
case nsIPermissionManager::PROMPT_ACTION:
|
||||
return PermissionState::Prompt;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
@ -1,20 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_PermissionUtils_h_
|
||||
#define mozilla_dom_PermissionUtils_h_
|
||||
|
||||
#include "mozilla/dom/PermissionsBinding.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
PermissionState ActionToPermissionState(uint32_t aAction);
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
@ -9,8 +9,8 @@
|
||||
#include "mozilla/dom/PermissionsBinding.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "PermissionUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -42,6 +42,22 @@ Permissions::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
|
||||
namespace {
|
||||
|
||||
PermissionState
|
||||
ActionToPermissionState(uint32_t aAction)
|
||||
{
|
||||
switch (aAction) {
|
||||
case nsIPermissionManager::ALLOW_ACTION:
|
||||
return PermissionState::Granted;
|
||||
|
||||
case nsIPermissionManager::DENY_ACTION:
|
||||
return PermissionState::Denied;
|
||||
|
||||
default:
|
||||
case nsIPermissionManager::PROMPT_ACTION:
|
||||
return PermissionState::Prompt;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
CheckPermission(const char* aName,
|
||||
nsPIDOMWindow* aWindow,
|
||||
|
@ -12,7 +12,6 @@ EXPORTS.mozilla.dom += [
|
||||
UNIFIED_SOURCES += [
|
||||
'Permissions.cpp',
|
||||
'PermissionStatus.cpp',
|
||||
'PermissionUtils.cpp',
|
||||
]
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
|
Loading…
Reference in New Issue
Block a user