+2012-06-14 Chris Guan <chris.guan@torchmobile.com.cn>
+
+ [Blackberry] add a new Api named setAllowNotification
+ https://bugs.webkit.org/show_bug.cgi?id=88950
+
+ Reviewed by Antonio Gomes.
+
+ Add a new API named setAllowNotification in webpage class to
+ let client set those allowed domains into notifications.
+
+ Test case:
+ * ManualTests/blackberry/notification.html: Added.
+
2012-06-13 Zan Dobersek <zandobersek@gmail.com>
[Gtk] Enable link prefetch support in the developer builds
--- /dev/null
+<html>
+<head>
+<script type="text/javascript">
+var n;
+function setNotification()
+{
+ if (window.webkitNotifications.checkPermission() != 0) {
+ alert("you don't have permission to post notifications, please allow notifications by clicking that link");
+ document.getElementById('allowNotificationLink').style.backgroundColor = 'Red';
+ return 0;
+ }
+ n = window.webkitNotifications.createNotification(window.location.href + '/favicon.ico', 'Notify me', 'This is the notification body');
+ log = document.getElementById("place");
+ n.onshow = function() { log.innerText = "notification showing"; }
+ n.onclick = function() { log.innerText = "notification clicked"; }
+ n.onerror = function() { log.innerText = "notification error"; }
+ n.onclose = function() { log.innerText = "notification closed"; }
+ n.show();
+ log.innerText = "Did you notice the notification ? There are 3 ways the notification will go away:\n 1. It automically goes away in 30 seconds;\n 2. you can click the close button on the notification to close it;\n 3. Click above link 'Click to cancel the notification.\n\n Please verify all work; Whenever the icon is clicked, cancelled, closed, etc. there will be corresponding log is this area, please notice if they show up.";
+
+ setTimeout(timeout, 30000);
+ function timeout() {
+ n.cancel();
+ }
+}
+
+function setAllowNotification()
+{
+ window.webkitNotifications.requestPermission(permissionGranted);
+}
+
+function permissionGranted()
+{
+ if (window.webkitNotifications.checkPermission() == 0)
+ alert("you now have permission to post Notifications");
+ else
+ alert("you don't have permission to post Notifications");
+}
+</script>
+</head>
+
+<body style="font-size:x-large">
+<a style="margin-left: 20px;" id="allowNotificationLink" onclick="setAllowNotification(); return false;" href="#">Click to set allow notifications first</a> <br>
+
+<a style="margin-left: 20px;" onclick="setNotification(); return false;" href="#">Click to set notification</a> <br>
+<a style="margin-left: 20px;" onclick="n.cancel(); return false;" href="#">Click to cancel the notification</a> <br>
+<br><br>
+<div id="place">
+</div>
+
+</body>
+</html>
+
return "";
}
+void WebPage::setAllowNotification(const WebString& domain, bool allow)
+{
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ static_cast<NotificationPresenterImpl*>(NotificationPresenterImpl::instance())->onPermission(domain.utf8(), allow);
+#else
+ UNUSED_PARAM(domain);
+ UNUSED_PARAM(allow);
+#endif
+}
+
void WebPage::setJavaScriptCanAccessClipboard(bool enabled)
{
d->m_page->settings()->setJavaScriptCanAccessClipboard(enabled);
+2012-06-14 Chris Guan <chris.guan@torchmobile.com.cn>
+
+ [Blackberry] add a new Api named setAllowNotification
+ https://bugs.webkit.org/show_bug.cgi?id=88950
+
+ Reviewed by Antonio Gomes.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::setAllowNotification):
+ (WebKit):
+ * Api/WebPage.h:
+
2012-06-13 Crystal Zhang <haizhang@rim.com>
[BlackBerry] Apply New Style and JS for Select Popup