| Index: Source/modules/notifications/Notification.cpp
|
| diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
|
| index 1dd3a947ddb0548d6fcab6eca34bee9fbbf68786..461ee1c9c161a53b4e4ba8d5adeedeb7f1c6425a 100644
|
| --- a/Source/modules/notifications/Notification.cpp
|
| +++ b/Source/modules/notifications/Notification.cpp
|
| @@ -167,7 +167,7 @@ void Notification::show()
|
| ASSERT(origin);
|
|
|
| // FIXME: Do CSP checks on the associated notification icon.
|
| - WebNotificationData::Direction dir = m_dir == "rtl" ? WebNotificationData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight;
|
| + WebNotificationData::Direction dir = directionStringToEnum(m_dir);
|
|
|
| // The lifetime and availability of non-persistent notifications is tied to the page
|
| // they were created by, and thus the data doesn't have to be known to the embedder.
|
| @@ -227,12 +227,6 @@ void Notification::dispatchCloseEvent()
|
| dispatchEvent(Event::create(EventTypeNames::close));
|
| }
|
|
|
| -TextDirection Notification::direction() const
|
| -{
|
| - // FIXME: Resolve dir()=="auto" against the document.
|
| - return dir() == "rtl" ? RTL : LTR;
|
| -}
|
| -
|
| String Notification::permissionString(WebNotificationPermission permission)
|
| {
|
| switch (permission) {
|
| @@ -248,6 +242,21 @@ String Notification::permissionString(WebNotificationPermission permission)
|
| return "denied";
|
| }
|
|
|
| +WebNotificationData Notification::directionStringToEnum(String direction)
|
| +{
|
| + switch (direction) {
|
| + case "ltr":
|
| + return DirectionLeftToRight;
|
| + case "rtl":
|
| + return DirectionRightToLeft;
|
| + case "auto":
|
| + return DirectionAuto;
|
| + }
|
| +
|
| + ASSERT_NOT_REACHED();
|
| + return DirectionAuto;
|
| +}
|
| +
|
| String Notification::permission(ExecutionContext* context)
|
| {
|
| return permissionString(checkPermission(context));
|
|
|