| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebNotification_h | 31 #ifndef WebNotification_h |
| 32 #define WebNotification_h | 32 #define WebNotification_h |
| 33 | 33 |
| 34 #include "../platform/WebCommon.h" | 34 #include "../platform/WebCommon.h" |
| 35 #include "../platform/WebPrivatePtr.h" | 35 #include "../platform/WebPrivatePtr.h" |
| 36 #include "../platform/WebString.h" | 36 #include "../platform/WebString.h" |
| 37 #include "WebTextDirection.h" | 37 #include "WebTextDirection.h" |
| 38 | 38 |
| 39 namespace blink { class Notification; } | |
| 40 | |
| 41 #if BLINK_IMPLEMENTATION | 39 #if BLINK_IMPLEMENTATION |
| 42 namespace WTF { template <typename T> class PassRefPtr; } | 40 namespace WTF { template <typename T> class PassRefPtr; } |
| 43 #endif | 41 #endif |
| 44 | 42 |
| 45 namespace blink { | 43 namespace blink { |
| 46 | 44 |
| 45 class Notification; |
| 47 class WebURL; | 46 class WebURL; |
| 48 | 47 |
| 49 // Represents access to a desktop notification. | 48 // Represents access to a desktop notification. |
| 50 class WebNotification { | 49 class WebNotification { |
| 51 public: | 50 public: |
| 52 WebNotification() { } | 51 WebNotification() { } |
| 53 WebNotification(const WebNotification& other) { assign(other); } | 52 WebNotification(const WebNotification& other) { assign(other); } |
| 54 WebNotification& operator=(const WebNotification& other) | 53 WebNotification& operator=(const WebNotification& other) |
| 55 { | 54 { |
| 56 assign(other); | 55 assign(other); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 BLINK_EXPORT void dispatchCloseEvent(bool byUser); | 85 BLINK_EXPORT void dispatchCloseEvent(bool byUser); |
| 87 | 86 |
| 88 // Called to indicate the notification was clicked on. | 87 // Called to indicate the notification was clicked on. |
| 89 BLINK_EXPORT void dispatchClickEvent(); | 88 BLINK_EXPORT void dispatchClickEvent(); |
| 90 | 89 |
| 91 // FIXME: Remove these methods once Chromium switched to the new APIs. | 90 // FIXME: Remove these methods once Chromium switched to the new APIs. |
| 92 WebString replaceId() const { return tag(); } | 91 WebString replaceId() const { return tag(); } |
| 93 void dispatchDisplayEvent() { dispatchShowEvent(); } | 92 void dispatchDisplayEvent() { dispatchShowEvent(); } |
| 94 | 93 |
| 95 #if BLINK_IMPLEMENTATION | 94 #if BLINK_IMPLEMENTATION |
| 96 WebNotification(blink::Notification*); | 95 WebNotification(Notification*); |
| 97 WebNotification& operator=(blink::Notification*); | 96 WebNotification& operator=(Notification*); |
| 98 #endif | 97 #endif |
| 99 | 98 |
| 100 private: | 99 private: |
| 101 WebPrivatePtr<blink::Notification> m_private; | 100 WebPrivatePtr<Notification> m_private; |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 inline bool operator==(const WebNotification& a, const WebNotification& b) | 103 inline bool operator==(const WebNotification& a, const WebNotification& b) |
| 105 { | 104 { |
| 106 return a.equals(b); | 105 return a.equals(b); |
| 107 } | 106 } |
| 108 | 107 |
| 109 inline bool operator!=(const WebNotification& a, const WebNotification& b) | 108 inline bool operator!=(const WebNotification& a, const WebNotification& b) |
| 110 { | 109 { |
| 111 return !a.equals(b); | 110 return !a.equals(b); |
| 112 } | 111 } |
| 113 | 112 |
| 114 inline bool operator<(const WebNotification& a, const WebNotification& b) | 113 inline bool operator<(const WebNotification& a, const WebNotification& b) |
| 115 { | 114 { |
| 116 return a.lessThan(b); | 115 return a.lessThan(b); |
| 117 } | 116 } |
| 118 | 117 |
| 119 } // namespace blink | 118 } // namespace blink |
| 120 | 119 |
| 121 #endif | 120 #endif |
| OLD | NEW |