+2012-02-21 Jon Lee <jonlee@apple.com>
+
+ Build fix. Push ENABLE_NOTIFICATIONS into .mm file.
+
+ * WebCoreSupport/WebNotificationClient.h:
+ * WebView/WebNotification.h:
+ * WebView/WebNotification.mm:
+ (-[WebNotification title]):
+ (-[WebNotification body]):
+ (-[WebNotification origin]):
+ (-[WebNotification notificationID]):
+ (-[WebNotification dispatchShowEvent]):
+ (-[WebNotification dispatchCloseEvent]):
+ (-[WebNotification dispatchClickEvent]):
+ (-[WebNotification dispatchErrorEvent]):
+
2012-02-21 John Sullivan <sullivan@apple.com>
Build fix.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if ENABLE(NOTIFICATIONS)
@class WebNotificationPrivate;
@class WebSecurityOrigin;
-#endif
@interface WebNotification : NSObject
{
-#if ENABLE(NOTIFICATIONS)
WebNotificationPrivate *_private;
-#endif
}
-#if ENABLE(NOTIFICATIONS)
- (NSString *)title;
- (NSString *)body;
- (WebSecurityOrigin *)origin;
- (void)dispatchCloseEvent;
- (void)dispatchClickEvent;
- (void)dispatchErrorEvent;
-#endif
@end
#import "WebNotification.h"
-#if ENABLE(NOTIFICATIONS)
-
#import "WebNotificationInternal.h"
+
+#if ENABLE(NOTIFICATIONS)
#import "WebSecurityOriginInternal.h"
#import <WebCore/Notification.h>
#import <WebCore/ScriptExecutionContext.h>
-#import <wtf/PassRefPtr.h>
#import <wtf/RefPtr.h>
using namespace WebCore;
+#endif
OBJC_CLASS WebNotificationInternal;
@interface WebNotificationPrivate : NSObject
{
@public
+#if ENABLE(NOTIFICATIONS)
RefPtr<Notification> _internal;
uint64_t _notificationID;
+#endif
}
@end
@implementation WebNotificationPrivate
@end
+#if ENABLE(NOTIFICATIONS)
@implementation WebNotification (WebNotificationInternal)
Notification* core(WebNotification *notification)
{
return self;
}
@end
+#endif
@implementation WebNotification
- (id)init
- (NSString *)title
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
return core(self)->contents().title;
+#else
+ return nil;
+#endif
}
- (NSString *)body
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
return core(self)->contents().body;
+#else
+ return nil;
+#endif
}
- (WebSecurityOrigin *)origin
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease];
+#else
+ return nil;
+#endif
}
- (uint64_t)notificationID
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
return _private->_notificationID;
+#else
+ return 0;
+#endif
}
- (void)dispatchShowEvent
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
core(self)->dispatchShowEvent();
+#endif
}
- (void)dispatchCloseEvent
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
core(self)->dispatchCloseEvent();
+#endif
}
- (void)dispatchClickEvent
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
core(self)->dispatchClickEvent();
+#endif
}
- (void)dispatchErrorEvent
{
+#if ENABLE(NOTIFICATIONS)
ASSERT(core(self));
core(self)->dispatchErrorEvent();
+#endif
}
@end
-#else
-
-@implementation WebNotification
-@end
-
-#endif // ENABLE(NOTIFICATIONS)
-