Backed out changeset 1e13c9c09273 (bug 1105827)

CLOSED TREE
This commit is contained in:
Birunthan Mohanathas 2015-08-11 10:04:36 -07:00
parent f4a1d6e1ea
commit 199d0bdf4c
4 changed files with 17 additions and 51 deletions

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -12,7 +12,6 @@ EXPORTS.mozilla.dom += [
UNIFIED_SOURCES += [
'Permissions.cpp',
'PermissionStatus.cpp',
'PermissionUtils.cpp',
]
EXTRA_COMPONENTS += [