summaryrefslogtreecommitdiffstats
path: root/webkit/glue/clipboard_conversion.cc
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/clipboard_conversion.cc
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/clipboard_conversion.cc')
-rw-r--r--webkit/glue/clipboard_conversion.cc78
1 files changed, 0 insertions, 78 deletions
diff --git a/webkit/glue/clipboard_conversion.cc b/webkit/glue/clipboard_conversion.cc
deleted file mode 100644
index 28f191d..0000000
--- a/webkit/glue/clipboard_conversion.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-
-#include "webkit/glue/clipboard_conversion.h"
-
-#include "build/build_config.h"
-
-#include "ChromiumDataObject.h"
-#include "ClipboardUtilitiesChromium.h"
-#include "KURL.h"
-#include "SharedBuffer.h"
-#include <wtf/Vector.h>
-
-#include "webkit/glue/glue_util.h"
-
-namespace webkit_glue {
-
-WebDropData ChromiumDataObjectToWebDropData(
- WebCore::ChromiumDataObject* data_object) {
- WebDropData drop_data;
- drop_data.url = KURLToGURL(data_object->url);
- drop_data.url_title = StringToStdWString(data_object->urlTitle);
-
- drop_data.file_extension = StringToStdWString(data_object->fileExtension);
-
- for (size_t i = 0; i < data_object->filenames.size(); ++i) {
- drop_data.filenames.push_back(StringToStdWString(
- data_object->filenames[i]));
- }
-
- drop_data.plain_text = StringToStdWString(data_object->plainText);
-
- drop_data.text_html = StringToStdWString(data_object->textHtml);
- drop_data.html_base_url = KURLToGURL(data_object->htmlBaseUrl);
-
- drop_data.file_description_filename = StringToStdWString(
- data_object->fileContentFilename);
- if (data_object->fileContent) {
- drop_data.file_contents.assign(data_object->fileContent->data(),
- data_object->fileContent->size());
- }
-
- return drop_data;
-}
-
-PassRefPtr<WebCore::ChromiumDataObject> WebDropDataToChromiumDataObject(
- const WebDropData& drop_data) {
- RefPtr<WebCore::ChromiumDataObject> data_object =
- WebCore::ChromiumDataObject::create();
- data_object->url = GURLToKURL(drop_data.url);
- data_object->urlTitle = StdWStringToString(drop_data.url_title);
-
- data_object->fileExtension = StdWStringToString(drop_data.file_extension);
-
- for (size_t i = 0; i < drop_data.filenames.size(); ++i) {
- data_object->filenames.append(StdWStringToString(drop_data.filenames[i]));
- }
-
- data_object->plainText = StdWStringToString(drop_data.plain_text);
-
- data_object->textHtml = StdWStringToString(drop_data.text_html);
- data_object->htmlBaseUrl = GURLToKURL(drop_data.html_base_url);
-
- data_object->fileContentFilename = StdWStringToString(
- drop_data.file_description_filename);
- if (!drop_data.file_contents.empty()) {
- data_object->fileContent =
- WebCore::SharedBuffer::create(drop_data.file_contents.data(),
- drop_data.file_contents.size());
- }
-
- return data_object;
-}
-
-} // namespace webkit_glue