summaryrefslogtreecommitdiffstats
path: root/webkit/glue/glue_util.cc
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 /webkit/glue/glue_util.cc
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 'webkit/glue/glue_util.cc')
-rw-r--r--webkit/glue/glue_util.cc38
1 files changed, 33 insertions, 5 deletions
diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc
index 05a395a..2601970 100644
--- a/webkit/glue/glue_util.cc
+++ b/webkit/glue/glue_util.cc
@@ -2,6 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// TODO(darin): This file will be deleted once we complete the move to
+// third_party/WebKit/WebKit/chromium
+
+// In this file, we pretend to be part of the WebKit implementation.
+// This is just a temporary hack while glue is still being moved into
+// third_party/WebKit/WebKit/chromium.
+#define WEBKIT_IMPLEMENTATION 1
+
#include "config.h"
#include "webkit/glue/glue_util.h"
@@ -20,11 +28,7 @@
#include "base/sys_string_conversions.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
-
-
-// TODO(darin): This file will be deleted once we complete the move to
-// third_party/WebKit/WebKit/chromium
-
+#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
namespace webkit_glue {
@@ -82,6 +86,22 @@ WebCore::String StdStringToString(const std::string& str) {
static_cast<unsigned>(str.length()));
}
+WebKit::WebString StringToWebString(const WebCore::String& str) {
+ return str;
+}
+
+WebCore::String WebStringToString(const WebKit::WebString& str) {
+ return str;
+}
+
+WebKit::WebCString CStringToWebCString(const WebCore::CString& str) {
+ return str;
+}
+
+WebCore::CString WebCStringToCString(const WebKit::WebCString& str) {
+ return str;
+}
+
FilePath::StringType StringToFilePathString(const WebCore::String& str) {
#if defined(OS_WIN)
return StringToStdWString(str);
@@ -127,6 +147,14 @@ GURL StringToGURL(const WebCore::String& spec) {
return GURL(WideToUTF8(StringToStdWString(spec)));
}
+WebKit::WebURL KURLToWebURL(const WebCore::KURL& url) {
+ return url;
+}
+
+WebCore::KURL WebURLToKURL(const WebKit::WebURL& url) {
+ return url;
+}
+
// Rect conversions ------------------------------------------------------------
gfx::Rect FromIntRect(const WebCore::IntRect& r) {