summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 17:13:49 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 17:13:49 +0000
commit04b0c9332361ac2f7de9455d0df15290db94c693 (patch)
treefdc8b47e5f7c57b3e7382a7a236e5b92675b3f87 /chrome/common
parent9e5c05aa2d4404c2a9946b49df19c2f781116b29 (diff)
downloadchromium_src-04b0c9332361ac2f7de9455d0df15290db94c693.zip
chromium_src-04b0c9332361ac2f7de9455d0df15290db94c693.tar.gz
chromium_src-04b0c9332361ac2f7de9455d0df15290db94c693.tar.bz2
Implement BiDi support and replace ID support for notifications.
BUG=none TEST=layout tests Review URL: http://codereview.chromium.org/1917004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/render_messages.h78
-rw-r--r--chrome/common/render_messages_internal.h12
2 files changed, 80 insertions, 10 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 6ee03d1..37658a5 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -39,6 +39,7 @@
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
#include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/glue/context_menu.h"
#include "webkit/glue/form_data.h"
@@ -657,6 +658,33 @@ struct ViewHostMsg_CreateWorker_Params {
int64 script_resource_appcache_id;
};
+// Parameters for the message that creates a desktop notification.
+struct ViewHostMsg_ShowNotification_Params {
+ // URL which is the origin that created this notification.
+ GURL origin;
+
+ // True if this is HTML
+ bool is_html;
+
+ // URL which contains the HTML contents (if is_html is true), otherwise empty.
+ GURL contents_url;
+
+ // Contents of the notification if is_html is false.
+ GURL icon_url;
+ string16 title;
+ string16 body;
+
+ // Directionality of the notification.
+ WebKit::WebTextDirection direction;
+
+ // ReplaceID if this notification should replace an existing one; may be
+ // empty if no replacement is called for.
+ string16 replace_id;
+
+ // Notification ID for sending events back for this notification.
+ int notification_id;
+};
+
// Creates a new view via a control message since the view doesn't yet exist.
struct ViewMsg_New_Params {
// The parent window's id.
@@ -2558,6 +2586,56 @@ struct ParamTraits<ViewHostMsg_CreateWorker_Params> {
}
};
+// Traits for ShowNotification_Params
+template <>
+struct ParamTraits<ViewHostMsg_ShowNotification_Params> {
+ typedef ViewHostMsg_ShowNotification_Params param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.origin);
+ WriteParam(m, p.is_html);
+ WriteParam(m, p.contents_url);
+ WriteParam(m, p.icon_url);
+ WriteParam(m, p.title);
+ WriteParam(m, p.body);
+ WriteParam(m, p.direction);
+ WriteParam(m, p.replace_id);
+ WriteParam(m, p.notification_id);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->origin) &&
+ ReadParam(m, iter, &p->is_html) &&
+ ReadParam(m, iter, &p->contents_url) &&
+ ReadParam(m, iter, &p->icon_url) &&
+ ReadParam(m, iter, &p->title) &&
+ ReadParam(m, iter, &p->body) &&
+ ReadParam(m, iter, &p->direction) &&
+ ReadParam(m, iter, &p->replace_id) &&
+ ReadParam(m, iter, &p->notification_id);
+ }
+ static void Log(const param_type &p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.origin, l);
+ l->append(L", ");
+ LogParam(p.is_html, l);
+ l->append(L", ");
+ LogParam(p.contents_url, l);
+ l->append(L", ");
+ LogParam(p.icon_url, l);
+ l->append(L", ");
+ LogParam(p.title, l);
+ l->append(L",");
+ LogParam(p.body, l);
+ l->append(L",");
+ LogParam(p.direction, l);
+ l->append(L",");
+ LogParam(p.replace_id, l);
+ l->append(L",");
+ LogParam(p.notification_id, l);
+ l->append(L")");
+ }
+};
+
// Traits for WebCookie
template <>
struct ParamTraits<webkit_glue::WebCookie> {
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index b7cda04..0b8e903 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -2036,16 +2036,8 @@ IPC_BEGIN_MESSAGES(ViewHost)
// A message sent to the browser on behalf of a renderer which wants to show
// a desktop notification.
- IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowDesktopNotification,
- GURL /* origin */,
- GURL /* contents_url */,
- int /* notification_id */)
- IPC_MESSAGE_ROUTED5(ViewHostMsg_ShowDesktopNotificationText,
- GURL /* origin */,
- GURL /* icon_url */,
- string16 /* title */,
- string16 /* text */,
- int /* notification_id */)
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowDesktopNotification,
+ ViewHostMsg_ShowNotification_Params)
IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelDesktopNotification,
int /* notification_id */ )
IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestNotificationPermission,