зеркало из https://github.com/mozilla/gecko-dev.git
Bug 782211 - Follow up to fix compilation error with gcc 4.7. r=wchen
This commit is contained in:
Родитель
429beaa145
Коммит
413452f34e
|
@ -36,7 +36,7 @@ public:
|
|||
NotificationPermissionRequest(nsIPrincipal* aPrincipal, nsPIDOMWindow* aWindow,
|
||||
NotificationPermissionCallback* aCallback)
|
||||
: mPrincipal(aPrincipal), mWindow(aWindow),
|
||||
mPermission(NotificationPermission::Default),
|
||||
mPermission(NotificationPermissionValues::Default),
|
||||
mCallback(aCallback) {}
|
||||
|
||||
virtual ~NotificationPermissionRequest() {}
|
||||
|
@ -111,19 +111,19 @@ NotificationPermissionRequest::Run()
|
|||
bool isFile;
|
||||
uri->SchemeIs("file", &isFile);
|
||||
if (isFile) {
|
||||
mPermission = NotificationPermission::Granted;
|
||||
mPermission = NotificationPermissionValues::Granted;
|
||||
}
|
||||
|
||||
// Grant permission if pref'ed on.
|
||||
if (Preferences::GetBool("notification.prompt.testing", false)) {
|
||||
if (Preferences::GetBool("notification.prompt.testing.allow", true)) {
|
||||
mPermission = NotificationPermission::Granted;
|
||||
mPermission = NotificationPermissionValues::Granted;
|
||||
} else {
|
||||
mPermission = NotificationPermission::Denied;
|
||||
mPermission = NotificationPermissionValues::Denied;
|
||||
}
|
||||
}
|
||||
|
||||
if (mPermission != NotificationPermission::Default) {
|
||||
if (mPermission != NotificationPermissionValues::Default) {
|
||||
return DispatchCallback();
|
||||
}
|
||||
|
||||
|
@ -180,14 +180,14 @@ NotificationPermissionRequest::GetElement(nsIDOMElement** aElement)
|
|||
NS_IMETHODIMP
|
||||
NotificationPermissionRequest::Cancel()
|
||||
{
|
||||
mPermission = NotificationPermission::Denied;
|
||||
mPermission = NotificationPermissionValues::Denied;
|
||||
return DispatchCallback();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NotificationPermissionRequest::Allow()
|
||||
{
|
||||
mPermission = NotificationPermission::Granted;
|
||||
mPermission = NotificationPermissionValues::Granted;
|
||||
return DispatchCallback();
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ Notification::ShowInternal()
|
|||
|
||||
ErrorResult result;
|
||||
if (GetPermissionInternal(GetOwner(), result) !=
|
||||
NotificationPermission::Granted || !alertService) {
|
||||
NotificationPermissionValues::Granted || !alertService) {
|
||||
// We do not have permission to show a notification or alert service
|
||||
// is not available.
|
||||
return DispatchTrustedEvent(NS_LITERAL_STRING("error"));
|
||||
|
@ -396,7 +396,7 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv)
|
|||
nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(aGlobal);
|
||||
if (!sop) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return NotificationPermission::Denied;
|
||||
return NotificationPermissionValues::Denied;
|
||||
}
|
||||
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
|
||||
|
||||
|
@ -406,15 +406,15 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv)
|
|||
bool isFile;
|
||||
uri->SchemeIs("file", &isFile);
|
||||
if (isFile) {
|
||||
return NotificationPermission::Granted;
|
||||
return NotificationPermissionValues::Granted;
|
||||
}
|
||||
|
||||
// We also allow notifications is they are pref'ed on.
|
||||
if (Preferences::GetBool("notification.prompt.testing", false)) {
|
||||
if (Preferences::GetBool("notification.prompt.testing.allow", true)) {
|
||||
return NotificationPermission::Granted;
|
||||
return NotificationPermissionValues::Granted;
|
||||
} else {
|
||||
return NotificationPermission::Denied;
|
||||
return NotificationPermissionValues::Denied;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,11 +438,11 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv)
|
|||
// Convert the result to one of the enum types.
|
||||
switch (permission) {
|
||||
case nsIPermissionManager::ALLOW_ACTION:
|
||||
return NotificationPermission::Granted;
|
||||
return NotificationPermissionValues::Granted;
|
||||
case nsIPermissionManager::DENY_ACTION:
|
||||
return NotificationPermission::Denied;
|
||||
return NotificationPermissionValues::Denied;
|
||||
default:
|
||||
return NotificationPermission::Default;
|
||||
return NotificationPermissionValues::Default;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,9 +62,9 @@ protected:
|
|||
static const nsString DirectionToString(NotificationDirection aDirection)
|
||||
{
|
||||
switch (aDirection) {
|
||||
case NotificationDirection::Ltr:
|
||||
case NotificationDirectionValues::Ltr:
|
||||
return NS_LITERAL_STRING("ltr");
|
||||
case NotificationDirection::Rtl:
|
||||
case NotificationDirectionValues::Rtl:
|
||||
return NS_LITERAL_STRING("rtl");
|
||||
default:
|
||||
return NS_LITERAL_STRING("auto");
|
||||
|
|
Загрузка…
Ссылка в новой задаче