| 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 27 matching lines...) Expand all Loading... |
| 38 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 39 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class Dictionary; | 43 class Dictionary; |
| 44 class ExecutionContext; | 44 class ExecutionContext; |
| 45 class NotificationClient; | 45 class NotificationClient; |
| 46 class NotificationPermissionCallback; | 46 class NotificationPermissionCallback; |
| 47 | 47 |
| 48 class Notification : public RefCounted<Notification>, public NotificationBase { | 48 class Notification FINAL : public RefCounted<Notification>, public NotificationB
ase { |
| 49 REFCOUNTED_EVENT_TARGET(Notification); | 49 REFCOUNTED_EVENT_TARGET(Notification); |
| 50 | 50 |
| 51 public: | 51 public: |
| 52 static PassRefPtr<Notification> create(ExecutionContext*, const String& titl
e, const Dictionary& options); | 52 static PassRefPtr<Notification> create(ExecutionContext*, const String& titl
e, const Dictionary& options); |
| 53 | 53 |
| 54 virtual ~Notification(); | 54 virtual ~Notification(); |
| 55 | 55 |
| 56 static const String& permission(ExecutionContext*); | 56 static const String& permission(ExecutionContext*); |
| 57 static void requestPermission(ExecutionContext*, PassOwnPtr<NotificationPerm
issionCallback> = nullptr); | 57 static void requestPermission(ExecutionContext*, PassOwnPtr<NotificationPerm
issionCallback> = nullptr); |
| 58 | 58 |
| 59 // EventTarget interface | 59 // EventTarget interface |
| 60 virtual const AtomicString& interfaceName() const OVERRIDE; | 60 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 61 | 61 |
| 62 // ActiveDOMObject interface | 62 // ActiveDOMObject interface |
| 63 virtual void stop() OVERRIDE; | 63 virtual void stop() OVERRIDE; |
| 64 virtual bool hasPendingActivity() const OVERRIDE; | 64 virtual bool hasPendingActivity() const OVERRIDE; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 Notification(ExecutionContext*, const String& title, NotificationClient*); | 67 Notification(ExecutionContext*, const String& title, NotificationClient*); |
| 68 | 68 |
| 69 void showSoon(); | 69 void showSoon(); |
| 70 | 70 |
| 71 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; | 71 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace WebCore | 74 } // namespace WebCore |
| 75 | 75 |
| 76 #endif // Notifications_h | 76 #endif // Notifications_h |
| OLD | NEW |