diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:08:40 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:08:40 +0000 |
commit | 4f999134a2e270792abc8b5ac6ad70aa500dcef4 (patch) | |
tree | e90d972ee2f29d10d6e22220d54cd142925bb2bb /chrome/test/automation/automation_messages.h | |
parent | b5cd43eb964e452d7a0245b9e14bd9a9d1e89b4a (diff) | |
download | chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.zip chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.tar.gz chromium_src-4f999134a2e270792abc8b5ac6ad70aa500dcef4.tar.bz2 |
Use WebScriptSource and WebFindInPageRequest from the WebKit API.
This change introduces some helper functions in glue_util.cc for efficient
conversion between WebString and WebCore::String when inside the implementation
of webkit/glue. This is a temporary change since eventually all code in glue
that uses WebCore will be moved into the WebKit API implementation.
Instead of making the Chrome automation use WebFindInPageRequest, I decided to
introduce AutomationMsg_Find_Params as a copy of the old FindInPageRequest
structure. That preserves the IPC protocol and avoids making the automation
library depend on WebKit.
R=dglazkov
Review URL: http://codereview.chromium.org/57060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/automation_messages.h')
-rw-r--r-- | chrome/test/automation/automation_messages.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages.h b/chrome/test/automation/automation_messages.h index 52a9945..5968f78 100644 --- a/chrome/test/automation/automation_messages.h +++ b/chrome/test/automation/automation_messages.h @@ -13,9 +13,49 @@ #include "chrome/common/ipc_message_utils.h" #include "chrome/test/automation/automation_constants.h" +struct AutomationMsg_Find_Params { + // Unused value, which exists only for backwards compat. + int unused; + + // The word(s) to find on the page. + string16 search_string; + + // Whether to search forward or backward within the page. + bool forward; + + // Whether search should be Case sensitive. + bool match_case; + + // Whether this operation is first request (Find) or a follow-up (FindNext). + bool find_next; +}; + namespace IPC { template <> +struct ParamTraits<AutomationMsg_Find_Params> { + typedef AutomationMsg_Find_Params param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.unused); + 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->unused) && + 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"<AutomationMsg_Find_Params>"); + } +}; + +template <> struct ParamTraits<AutomationMsg_NavigationResponseValues> { typedef AutomationMsg_NavigationResponseValues param_type; static void Write(Message* m, const param_type& p) { |