summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-31 18:08:40 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-31 18:08:40 +0000
commit4f999134a2e270792abc8b5ac6ad70aa500dcef4 (patch)
treee90d972ee2f29d10d6e22220d54cd142925bb2bb /chrome/browser
parentb5cd43eb964e452d7a0245b9e14bd9a9d1e89b4a (diff)
downloadchromium_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/browser')
-rw-r--r--chrome/browser/automation/automation_provider.cc12
-rw-r--r--chrome/browser/automation/automation_provider.h3
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc12
3 files changed, 14 insertions, 13 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index b3699b8..d80401d 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/browser/tab_contents/web_contents_view.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/ipc_message_utils.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/pref_service.h"
#include "chrome/test/automation/automation_messages.h"
@@ -1914,9 +1913,10 @@ void AutomationProvider::HandleFindInPageRequest(
return;
}
-void AutomationProvider::HandleFindRequest(int handle,
- const FindInPageRequest& request,
- IPC::Message* reply_message) {
+void AutomationProvider::HandleFindRequest(
+ int handle,
+ const AutomationMsg_Find_Params& params,
+ IPC::Message* reply_message) {
if (!tab_tracker_->ContainsHandle(handle)) {
AutomationMsg_FindInPage::WriteReplyParams(reply_message, -1, -1);
Send(reply_message);
@@ -1937,8 +1937,8 @@ void AutomationProvider::HandleFindRequest(int handle,
FindInPageNotificationObserver::kFindInPageRequestId);
web_contents->render_view_host()->StartFinding(
FindInPageNotificationObserver::kFindInPageRequestId,
- request.search_string, request.forward, request.match_case,
- request.find_next);
+ params.search_string, params.forward, params.match_case,
+ params.find_next);
}
}
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 38008d0..1bf0892 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -26,7 +26,6 @@
#include "chrome/common/notification_observer.h"
#include "chrome/test/automation/automation_messages.h"
#include "chrome/views/event.h"
-#include "webkit/glue/find_in_page_request.h"
#if defined(OS_WIN)
// TODO(port): enable these.
@@ -234,7 +233,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// Responds to the FindInPage request, retrieves the search query parameters,
// launches an observer to listen for results and issues a StartFind request.
void HandleFindRequest(int handle,
- const FindInPageRequest& request,
+ const AutomationMsg_Find_Params& params,
IPC::Message* reply_message);
// Responds to requests to open the FindInPage window.
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 8222ec3..0f0a889 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -34,9 +34,11 @@
#include "chrome/common/thumbnail_score.h"
#include "net/base/net_util.h"
#include "skia/include/SkBitmap.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h"
#include "webkit/glue/autofill_form.h"
using base::TimeDelta;
+using WebKit::WebFindInPageRequest;
using WebKit::WebInputEvent;
namespace {
@@ -351,12 +353,12 @@ void RenderViewHost::StartFinding(int request_id,
if (search_string.empty())
return;
- FindInPageRequest request;
- request.request_id = request_id;
- request.search_string = search_string;
+ WebFindInPageRequest request;
+ request.identifier = request_id;
+ request.text = search_string;
request.forward = forward;
- request.match_case = match_case;
- request.find_next = find_next;
+ request.matchCase = match_case;
+ request.findNext = find_next;
Send(new ViewMsg_Find(routing_id(), request));
// This call is asynchronous and returns immediately.