summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 01:40:12 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-05 01:40:12 +0000
commit90e908552cd4ed902be34e354775e3f711f06511 (patch)
tree61a3e4873856c60280a803925fcd6113e6512c10 /webkit
parent9e7a2378237e231b395c1faddd19fb349b8e8a23 (diff)
downloadchromium_src-90e908552cd4ed902be34e354775e3f711f06511.zip
chromium_src-90e908552cd4ed902be34e354775e3f711f06511.tar.gz
chromium_src-90e908552cd4ed902be34e354775e3f711f06511.tar.bz2
Adds desktop notification support for renderer process, and enables the build flag for chromium build of webkit. Doesn't expose the feature to any websites yet.
BUG=none TEST=none (This is part 1 of 3 for this feature; tests will follow). Review URL: http://codereview.chromium.org/194079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/api/public/WebNotification.h7
-rw-r--r--webkit/api/src/WebNotification.cpp14
2 files changed, 18 insertions, 3 deletions
diff --git a/webkit/api/public/WebNotification.h b/webkit/api/public/WebNotification.h
index 3d96c48..fb6cd6d 100644
--- a/webkit/api/public/WebNotification.h
+++ b/webkit/api/public/WebNotification.h
@@ -56,7 +56,9 @@ namespace WebKit {
WebNotification& operator=(const WebNotification& other) { assign(other); return *this; }
+ // Operators required to put WebNotification in an ordered map.
bool equals(const WebNotification& other) const { return m_private == other.m_private; }
+ bool lessThan(const WebNotification& other) const;
// Is the notification HTML vs. icon-title-text?
WEBKIT_API bool isHTML() const;
@@ -101,6 +103,11 @@ namespace WebKit {
return !a.equals(b);
}
+ inline bool operator<(const WebNotification& a, const WebNotification& b)
+ {
+ return a.lessThan(b);
+ }
+
} // namespace WebKit
#endif
diff --git a/webkit/api/src/WebNotification.cpp b/webkit/api/src/WebNotification.cpp
index 46baab7..2b2e3bb 100644
--- a/webkit/api/src/WebNotification.cpp
+++ b/webkit/api/src/WebNotification.cpp
@@ -58,6 +58,11 @@ void WebNotification::assign(const WebNotification& other)
assign(p);
}
+bool WebNotification::lessThan(const WebNotification& other) const
+{
+ return reinterpret_cast<uintptr_t>(m_private) < reinterpret_cast<uintptr_t>(other.m_private);
+}
+
bool WebNotification::isHTML() const
{
return m_private->isHTML();
@@ -89,19 +94,22 @@ WebString WebNotification::body() const
void WebNotification::dispatchDisplayEvent()
{
- m_private->dispatchDisplayEvent();
+ RefPtr<Event> event = Event::create("display", false, true);
+ m_private->dispatchEvent(event.release());
}
void WebNotification::dispatchErrorEvent(const WebKit::WebString& /* errorMessage */)
{
// FIXME: errorMessage not supported by WebCore yet
- m_private->dispatchErrorEvent();
+ RefPtr<Event> event = Event::create(eventNames().errorEvent, false, true);
+ m_private->dispatchEvent(event.release());
}
void WebNotification::dispatchCloseEvent(bool /* byUser */)
{
// FIXME: byUser flag not supported by WebCore yet
- m_private->dispatchCloseEvent();
+ RefPtr<Event> event = Event::create(eventNames().closeEvent, false, true);
+ m_private->dispatchEvent(event.release());
}
WebNotification::WebNotification(const WTF::PassRefPtr<Notification>& notification)