| 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) 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 namespace WebCore { | 50 namespace WebCore { |
| 51 | 51 |
| 52 class NotificationClient; | 52 class NotificationClient; |
| 53 class VoidCallback; | 53 class VoidCallback; |
| 54 | 54 |
| 55 class NotificationCenter : public RefCounted<NotificationCenter>, public ScriptW
rappable, public ActiveDOMObject { | 55 class NotificationCenter : public RefCounted<NotificationCenter>, public ScriptW
rappable, public ActiveDOMObject { |
| 56 public: | 56 public: |
| 57 static PassRefPtr<NotificationCenter> create(ExecutionContext*, Notification
Client*); | 57 static PassRefPtr<NotificationCenter> create(ExecutionContext*, Notification
Client*); |
| 58 | 58 |
| 59 #if ENABLE(LEGACY_NOTIFICATIONS) | 59 #if ENABLE(LEGACY_NOTIFICATIONS) |
| 60 PassRefPtr<Notification> createNotification(const String& iconURI, const Str
ing& title, const String& body, ExceptionState& es) | 60 PassRefPtr<Notification> createNotification(const String& iconURI, const Str
ing& title, const String& body, ExceptionState& exceptionState) |
| 61 { | 61 { |
| 62 if (!client()) { | 62 if (!client()) { |
| 63 es.throwUninformativeAndGenericDOMException(InvalidStateError); | 63 exceptionState.throwUninformativeAndGenericDOMException(InvalidState
Error); |
| 64 return 0; | 64 return 0; |
| 65 } | 65 } |
| 66 return Notification::create(title, body, iconURI, executionContext(), es
, this); | 66 return Notification::create(title, body, iconURI, executionContext(), ex
ceptionState, this); |
| 67 } | 67 } |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 NotificationClient* client() const { return m_client; } | 70 NotificationClient* client() const { return m_client; } |
| 71 | 71 |
| 72 #if ENABLE(LEGACY_NOTIFICATIONS) | 72 #if ENABLE(LEGACY_NOTIFICATIONS) |
| 73 int checkPermission(); | 73 int checkPermission(); |
| 74 void requestPermission(PassRefPtr<VoidCallback> = 0); | 74 void requestPermission(PassRefPtr<VoidCallback> = 0); |
| 75 #endif | 75 #endif |
| 76 | 76 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 NotificationClient* m_client; | 97 NotificationClient* m_client; |
| 98 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks; | 98 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace WebCore | 101 } // namespace WebCore |
| 102 | 102 |
| 103 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 103 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
| 104 | 104 |
| 105 #endif // NotificationCenter_h | 105 #endif // NotificationCenter_h |
| OLD | NEW |