OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
40 | 40 |
41 namespace WebCore { | 41 namespace WebCore { |
42 | 42 |
43 class ExceptionState; | 43 class ExceptionState; |
44 class ExecutionContext; | 44 class ExecutionContext; |
45 class NotificationCenter; | 45 class NotificationCenter; |
46 | 46 |
47 // Implementation of the legacy notification API as specified the following page
: | 47 // Implementation of the legacy notification API as specified the following page
: |
48 // http://chromium.org/developers/design-documents/desktop-notifications/api-spe
cification | 48 // http://chromium.org/developers/design-documents/desktop-notifications/api-spe
cification |
49 class WebKitNotification : public RefCounted<WebKitNotification>, public Notific
ationBase { | 49 class WebKitNotification FINAL : public RefCounted<WebKitNotification>, public N
otificationBase { |
50 REFCOUNTED_EVENT_TARGET(WebKitNotification); | 50 REFCOUNTED_EVENT_TARGET(WebKitNotification); |
51 | 51 |
52 public: | 52 public: |
53 static PassRefPtr<WebKitNotification> create(const String& title, const Stri
ng& body, const String& iconUrl, ExecutionContext*, ExceptionState&, PassRefPtr<
NotificationCenter> provider); | 53 static PassRefPtr<WebKitNotification> create(const String& title, const Stri
ng& body, const String& iconUrl, ExecutionContext*, ExceptionState&, PassRefPtr<
NotificationCenter> provider); |
54 | 54 |
55 virtual ~WebKitNotification(); | 55 virtual ~WebKitNotification(); |
56 | 56 |
57 void cancel() { close(); } | 57 void cancel() { close(); } |
58 | 58 |
59 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(display, show); | 59 DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(display, show); |
60 | 60 |
61 String replaceId() const { return tag(); } | 61 String replaceId() const { return tag(); } |
62 void setReplaceId(const String& replaceId) { setTag(replaceId); } | 62 void setReplaceId(const String& replaceId) { setTag(replaceId); } |
63 | 63 |
64 // EventTarget interface | 64 // EventTarget interface |
65 virtual const AtomicString& interfaceName() const OVERRIDE; | 65 virtual const AtomicString& interfaceName() const OVERRIDE; |
66 | 66 |
67 private: | 67 private: |
68 WebKitNotification(const String& title, const String& body, const String& ic
onUrl, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter> provid
er); | 68 WebKitNotification(const String& title, const String& body, const String& ic
onUrl, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter> provid
er); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace WebCore | 71 } // namespace WebCore |
72 | 72 |
73 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 73 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
74 | 74 |
75 #endif // WebKitNotification_h | 75 #endif // WebKitNotification_h |
OLD | NEW |