| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // FIXME: oilpan: Change this to GarbageCollectedFinalized once we move ActiveDO
MObject to oilpan. | 56 // FIXME: oilpan: Change this to GarbageCollectedFinalized once we move ActiveDO
MObject to oilpan. |
| 57 class NotificationCenter FINAL : public RefCountedWillBeGarbageCollectedFinalize
d<NotificationCenter>, public ScriptWrappable, public ActiveDOMObject { | 57 class NotificationCenter FINAL : public RefCountedWillBeGarbageCollectedFinalize
d<NotificationCenter>, public ScriptWrappable, public ActiveDOMObject { |
| 58 DECLARE_GC_INFO; | 58 DECLARE_GC_INFO; |
| 59 public: | 59 public: |
| 60 static PassRefPtrWillBeRawPtr<NotificationCenter> create(ExecutionContext*,
NotificationClient*); | 60 static PassRefPtrWillBeRawPtr<NotificationCenter> create(ExecutionContext*,
NotificationClient*); |
| 61 | 61 |
| 62 PassRefPtrWillBeRawPtr<WebKitNotification> createNotification(const String&
iconUrl, const String& title, const String& body, ExceptionState& exceptionState
) | 62 PassRefPtrWillBeRawPtr<WebKitNotification> createNotification(const String&
iconUrl, const String& title, const String& body, ExceptionState& exceptionState
) |
| 63 { | 63 { |
| 64 if (!client()) { | 64 if (!client()) { |
| 65 exceptionState.throwDOMException(InvalidStateError, "The notificatio
n client is null."); | 65 exceptionState.throwDOMException(InvalidStateError, "The notificatio
n client is null."); |
| 66 return 0; | 66 return nullptr; |
| 67 } | 67 } |
| 68 return WebKitNotification::create(title, body, iconUrl, executionContext
(), exceptionState, this); | 68 return WebKitNotification::create(title, body, iconUrl, executionContext
(), exceptionState, this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 NotificationClient* client() const { return m_client; } | 71 NotificationClient* client() const { return m_client; } |
| 72 | 72 |
| 73 int checkPermission(); | 73 int checkPermission(); |
| 74 void requestPermission(PassOwnPtr<VoidCallback> = nullptr); | 74 void requestPermission(PassOwnPtr<VoidCallback> = nullptr); |
| 75 | 75 |
| 76 virtual void stop() OVERRIDE; | 76 virtual void stop() OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 106 // FIXME: oilpan: Move this to ThreadState.h. | 106 // FIXME: oilpan: Move this to ThreadState.h. |
| 107 template<> struct ThreadingTrait<NotificationCenter::NotificationRequestCallback
> { | 107 template<> struct ThreadingTrait<NotificationCenter::NotificationRequestCallback
> { |
| 108 static const ThreadAffinity Affinity = AnyThread; | 108 static const ThreadAffinity Affinity = AnyThread; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace WebCore | 111 } // namespace WebCore |
| 112 | 112 |
| 113 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 113 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
| 114 | 114 |
| 115 #endif // NotificationCenter_h | 115 #endif // NotificationCenter_h |
| OLD | NEW |