diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 23:24:58 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 23:24:58 +0000 |
commit | e80c73be12cc2211d5a72a5ff85eb97366b2458f (patch) | |
tree | 5c395779776b368ed6cafdbc5c6bc929776c18a4 /chrome/browser/renderer_host | |
parent | 25a3f6b52228bc68ce63c4032ed6b17cecd7b3c5 (diff) | |
download | chromium_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 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index fa009e2..014737c 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -390,15 +390,16 @@ void RenderViewHost::FillPasswordForm( Send(new ViewMsg_FillPasswordForm(routing_id(), form_data)); } -void RenderViewHost::DragTargetDragEnter(const WebDropData& drop_data, - const gfx::Point& client_pt, const gfx::Point& screen_pt) { +void RenderViewHost::DragTargetDragEnter( + const WebDropData& drop_data, + const gfx::Point& client_pt, + const gfx::Point& screen_pt) { // Grant the renderer the ability to load the drop_data. RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance(); policy->GrantRequestURL(process()->pid(), drop_data.url); - for (std::vector<std::wstring>::const_iterator - iter(drop_data.filenames.begin()); + for (std::vector<string16>::const_iterator iter(drop_data.filenames.begin()); iter != drop_data.filenames.end(); ++iter) { - FilePath path = FilePath::FromWStringHack(*iter); + FilePath path = FilePath::FromWStringHack(UTF16ToWideHack(*iter)); policy->GrantRequestURL(process()->pid(), net::FilePathToFileURL(path)); policy->GrantUploadFile(process()->pid(), path); } @@ -571,13 +572,19 @@ void RenderViewHost::ShowJavaScriptConsole() { void RenderViewHost::DragSourceEndedAt( int client_x, int client_y, int screen_x, int screen_y) { Send(new ViewMsg_DragSourceEndedOrMoved( - routing_id(), client_x, client_y, screen_x, screen_y, true)); + routing_id(), + gfx::Point(client_x, client_y), + gfx::Point(screen_x, screen_y), + true)); } void RenderViewHost::DragSourceMovedTo( int client_x, int client_y, int screen_x, int screen_y) { Send(new ViewMsg_DragSourceEndedOrMoved( - routing_id(), client_x, client_y, screen_x, screen_y, false)); + routing_id(), + gfx::Point(client_x, client_y), + gfx::Point(screen_x, screen_y), + false)); } void RenderViewHost::DragSourceSystemDragEnded() { |