summaryrefslogtreecommitdiffstats
path: root/webkit/glue/glue_util.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 23:24:58 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 23:24:58 +0000
commite80c73be12cc2211d5a72a5ff85eb97366b2458f (patch)
tree5c395779776b368ed6cafdbc5c6bc929776c18a4 /webkit/glue/glue_util.h
parent25a3f6b52228bc68ce63c4032ed6b17cecd7b3c5 (diff)
downloadchromium_src-e80c73be12cc2211d5a72a5ff85eb97366b2458f.zip
chromium_src-e80c73be12cc2211d5a72a5ff85eb97366b2458f.tar.gz
chromium_src-e80c73be12cc2211d5a72a5ff85eb97366b2458f.tar.bz2
Switch to using WebDragData in WebView and WebViewDelegate.
I also cleaned up some of the WebView and WebViewDelegate methods to pass WebPoint instead of pairs of ints or gfx::Point. With this change, I am keeping webkit/glue/webdropdata.{h,cc}, which is what Chrome uses to pass around the equivalent data. Now, it is possible to construct a WebDropData from a WebKit::WebDragData and to also get a WebKit::WebDragData from a WebDropData. Hence, the conversion between WebDropData and ChromiumDataObject (see clipboard_conversion.{h,cc}) is now removed in favor of conversion between WebDropData and WebKit::WebDragData. Conversion between WebKit::WebDragData and WebCore::ChromiumDataObject is very cheap (just reference counting). Finally, this change also brings in WebData, which is now used by the return value of WebKitClient::loadResource. As a companion to that change, I also changed webkit_glue::GetDataResource to return StringPiece instead of std::string. That also saves on an unnecessary buffer copy. R=dglazkov Review URL: http://codereview.chromium.org/63084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_util.h')
-rw-r--r--webkit/glue/glue_util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/webkit/glue/glue_util.h b/webkit/glue/glue_util.h
index 5c9f90b..8f02767 100644
--- a/webkit/glue/glue_util.h
+++ b/webkit/glue/glue_util.h
@@ -11,7 +11,9 @@
class GURL;
namespace WebCore {
+class ChromiumDataObject;
class CString;
+class IntPoint;
class IntRect;
class KURL;
class String;
@@ -19,8 +21,14 @@ class String;
namespace WebKit {
class WebCString;
+class WebDragData;
class WebString;
class WebURL;
+struct WebPoint;
+}
+
+namespace WTF {
+template <typename T> class PassRefPtr;
}
namespace gfx {
@@ -73,6 +81,16 @@ WebCore::KURL WebURLToKURL(const WebKit::WebURL& url);
gfx::Rect FromIntRect(const WebCore::IntRect& r);
WebCore::IntRect ToIntRect(const gfx::Rect& r);
+// WebPoint <-> IntPoint
+WebCore::IntPoint WebPointToIntPoint(const WebKit::WebPoint&);
+WebKit::WebPoint IntPointToWebPoint(const WebCore::IntPoint&);
+
+// WebDragData <-> ChromiumDataObject
+WebKit::WebDragData ChromiumDataObjectToWebDragData(
+ const WTF::PassRefPtr<WebCore::ChromiumDataObject>&);
+WTF::PassRefPtr<WebCore::ChromiumDataObject> WebDragDataToChromiumDataObject(
+ const WebKit::WebDragData&);
+
} // namespace webkit_glue
#endif // #ifndef WEBKIT_GLUE_GLUE_UTIL_H_