summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/ipc_message_utils.h25
-rw-r--r--chrome/common/render_messages.h45
-rw-r--r--chrome/common/render_messages_internal.h2
3 files changed, 46 insertions, 26 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index e016074..bfdc54d 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -20,7 +20,6 @@
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/transport_dib.h"
#include "webkit/glue/console_message_level.h"
-#include "webkit/glue/find_in_page_request.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/window_open_disposition.h"
@@ -1390,30 +1389,6 @@ class MessageWithReply : public SyncMessage {
}
};
-// Traits for ViewMsg_FindInPageMsg_Request structure to pack/unpack.
-template <>
-struct ParamTraits<FindInPageRequest> {
- typedef FindInPageRequest param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.request_id);
- WriteParam(m, p.search_string);
- WriteParam(m, p.forward);
- WriteParam(m, p.match_case);
- WriteParam(m, p.find_next);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->request_id) &&
- ReadParam(m, iter, &p->search_string) &&
- ReadParam(m, iter, &p->forward) &&
- ReadParam(m, iter, &p->match_case) &&
- ReadParam(m, iter, &p->find_next);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<FindInPageRequest>");
- }
-};
-
//-----------------------------------------------------------------------------
} // namespace IPC
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 284ac51..e144a3a 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -25,6 +25,7 @@
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_status.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "webkit/glue/autofill_form.h"
#include "webkit/glue/context_menu.h"
@@ -370,6 +371,27 @@ struct ViewHostMsg_Audio_CreateStream {
namespace IPC {
template <>
+struct ParamTraits<WebKit::WebString> {
+ typedef WebKit::WebString param_type;
+ static void Write(Message* m, const param_type& p) {
+ m->WriteData(reinterpret_cast<const char*>(p.data()),
+ static_cast<int>(p.length()));
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ const char* data;
+ int length;
+ if (!m->ReadData(iter, &data, &length))
+ return false;
+ p->assign(reinterpret_cast<const WebKit::WebUChar*>(data),
+ static_cast<size_t>(length));
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(UTF16ToWideHack(p));
+ }
+};
+
+template <>
struct ParamTraits<ResourceType::Type> {
typedef ResourceType::Type param_type;
static void Write(Message* m, const param_type& p) {
@@ -1923,6 +1945,29 @@ struct ParamTraits<AudioOutputStream::State> {
}
};
+template <>
+struct ParamTraits<WebKit::WebFindInPageRequest> {
+ typedef WebKit::WebFindInPageRequest param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.identifier);
+ WriteParam(m, p.text);
+ WriteParam(m, p.forward);
+ WriteParam(m, p.matchCase);
+ WriteParam(m, p.findNext);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->identifier) &&
+ ReadParam(m, iter, &p->text) &&
+ ReadParam(m, iter, &p->forward) &&
+ ReadParam(m, iter, &p->matchCase) &&
+ ReadParam(m, iter, &p->findNext);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<FindInPageRequest>");
+ }
+};
+
} // namespace IPC
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index cc0ad9e..2dda292 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -160,7 +160,7 @@ IPC_BEGIN_MESSAGES(View)
// Sent when the user wants to search for a word on the page (find in page).
// Request parameters are passed in as a FindInPageMsg_Request struct.
- IPC_MESSAGE_ROUTED1(ViewMsg_Find, FindInPageRequest)
+ IPC_MESSAGE_ROUTED1(ViewMsg_Find, WebKit::WebFindInPageRequest)
// Sent when the headers are available for a resource request.
IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedResponse,