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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "wtf/OwnPtr.h" | 45 #include "wtf/OwnPtr.h" |
46 #include "wtf/PassRefPtr.h" | 46 #include "wtf/PassRefPtr.h" |
47 #include "wtf/RefCounted.h" | 47 #include "wtf/RefCounted.h" |
48 #include "wtf/RefPtr.h" | 48 #include "wtf/RefPtr.h" |
49 | 49 |
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 FINAL : public RefCounted<NotificationCenter>, public S
criptWrappable, 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 PassRefPtr<WebKitNotification> createNotification(const String& iconUrl, con
st String& title, const String& body, ExceptionState& exceptionState) | 59 PassRefPtr<WebKitNotification> createNotification(const String& iconUrl, con
st String& title, const String& body, ExceptionState& exceptionState) |
60 { | 60 { |
61 if (!client()) { | 61 if (!client()) { |
62 exceptionState.throwDOMException(InvalidStateError, "The notificatio
n client is null."); | 62 exceptionState.throwDOMException(InvalidStateError, "The notificatio
n client is null."); |
63 return 0; | 63 return 0; |
64 } | 64 } |
65 return WebKitNotification::create(title, body, iconUrl, executionContext
(), exceptionState, this); | 65 return WebKitNotification::create(title, body, iconUrl, executionContext
(), exceptionState, this); |
(...skipping 26 matching lines...) Expand all Loading... |
92 | 92 |
93 NotificationClient* m_client; | 93 NotificationClient* m_client; |
94 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks; | 94 HashSet<RefPtr<NotificationRequestCallback> > m_callbacks; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace WebCore | 97 } // namespace WebCore |
98 | 98 |
99 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 99 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
100 | 100 |
101 #endif // NotificationCenter_h | 101 #endif // NotificationCenter_h |
OLD | NEW |