| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 if (!iconURI.isEmpty() && iconURI.isValid()) | 127 if (!iconURI.isEmpty() && iconURI.isValid()) |
| 128 notification->setIconURL(iconURI); | 128 notification->setIconURL(iconURI); |
| 129 } | 129 } |
| 130 | 130 |
| 131 notification->suspendIfNeeded(); | 131 notification->suspendIfNeeded(); |
| 132 return notification.release(); | 132 return notification.release(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 const AtomicString& Notification::interfaceName() const | 135 const AtomicString& Notification::interfaceName() const |
| 136 { | 136 { |
| 137 return eventNames().interfaceForNotification; | 137 return EventTargetNames::Notification; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void Notification::show() | 140 void Notification::show() |
| 141 { | 141 { |
| 142 // prevent double-showing | 142 // prevent double-showing |
| 143 if (m_state == Idle) { | 143 if (m_state == Idle) { |
| 144 if (!toDocument(executionContext())->page()) | 144 if (!toDocument(executionContext())->page()) |
| 145 return; | 145 return; |
| 146 if (NotificationController::from(toDocument(executionContext())->page())
->client()->checkPermission(executionContext()) != NotificationClient::Permissio
nAllowed) { | 146 if (NotificationController::from(toDocument(executionContext())->page())
->client()->checkPermission(executionContext()) != NotificationClient::Permissio
nAllowed) { |
| 147 dispatchErrorEvent(); | 147 dispatchErrorEvent(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 return deniedPermission; | 248 return deniedPermission; |
| 249 } | 249 } |
| 250 | 250 |
| 251 void Notification::requestPermission(ExecutionContext* context, PassRefPtr<Notif
icationPermissionCallback> callback) | 251 void Notification::requestPermission(ExecutionContext* context, PassRefPtr<Notif
icationPermissionCallback> callback) |
| 252 { | 252 { |
| 253 ASSERT(toDocument(context)->page()); | 253 ASSERT(toDocument(context)->page()); |
| 254 NotificationController::from(toDocument(context)->page())->client()->request
Permission(context, callback); | 254 NotificationController::from(toDocument(context)->page())->client()->request
Permission(context, callback); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace WebCore | 257 } // namespace WebCore |
| OLD | NEW |