OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 | 706 |
707 void RenderViewHostImpl::DragTargetDrop( | 707 void RenderViewHostImpl::DragTargetDrop( |
708 const gfx::Point& client_pt, | 708 const gfx::Point& client_pt, |
709 const gfx::Point& screen_pt, | 709 const gfx::Point& screen_pt, |
710 int key_modifiers) { | 710 int key_modifiers) { |
711 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); | 711 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); |
712 Send(new DragMsg_TargetDrop(GetRoutingID(), client_pt_in_viewport, screen_pt, | 712 Send(new DragMsg_TargetDrop(GetRoutingID(), client_pt_in_viewport, screen_pt, |
713 key_modifiers)); | 713 key_modifiers)); |
714 } | 714 } |
715 | 715 |
| 716 #if defined(OS_ANDROID) |
| 717 void RenderViewHostImpl::DragTargetDropWithData(const DropData& drop_data, |
| 718 const gfx::Point& client_pt, |
| 719 const gfx::Point& screen_pt, |
| 720 int key_modifiers) { |
| 721 // TODO(hush): filter the drop_data when we start to support dragging files. |
| 722 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); |
| 723 Send(new DragMsg_TargetDropWithData(GetRoutingID(), drop_data, |
| 724 client_pt_in_viewport, screen_pt, |
| 725 key_modifiers)); |
| 726 } |
| 727 #endif |
| 728 |
716 void RenderViewHostImpl::DragSourceEndedAt( | 729 void RenderViewHostImpl::DragSourceEndedAt( |
717 int client_x, int client_y, int screen_x, int screen_y, | 730 int client_x, int client_y, int screen_x, int screen_y, |
718 WebDragOperation operation) { | 731 WebDragOperation operation) { |
719 const gfx::Point client_pt_in_viewport = | 732 const gfx::Point client_pt_in_viewport = |
720 ConvertDIPToViewport(gfx::Point(client_x, client_y)); | 733 ConvertDIPToViewport(gfx::Point(client_x, client_y)); |
721 Send(new DragMsg_SourceEnded(GetRoutingID(), client_pt_in_viewport, | 734 Send(new DragMsg_SourceEnded(GetRoutingID(), client_pt_in_viewport, |
722 gfx::Point(screen_x, screen_y), operation)); | 735 gfx::Point(screen_x, screen_y), operation)); |
723 } | 736 } |
724 | 737 |
725 void RenderViewHostImpl::DragSourceSystemDragEnded() { | 738 void RenderViewHostImpl::DragSourceSystemDragEnded() { |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 | 1383 |
1371 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { | 1384 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { |
1372 // The point in guest view is already converted. | 1385 // The point in guest view is already converted. |
1373 if (!render_widget_host_->scale_input_to_viewport()) | 1386 if (!render_widget_host_->scale_input_to_viewport()) |
1374 return point; | 1387 return point; |
1375 float scale = GetWidget()->GetView()->current_device_scale_factor(); | 1388 float scale = GetWidget()->GetView()->current_device_scale_factor(); |
1376 return gfx::Point(point.x() * scale, point.y() * scale); | 1389 return gfx::Point(point.x() * scale, point.y() * scale); |
1377 } | 1390 } |
1378 | 1391 |
1379 } // namespace content | 1392 } // namespace content |
OLD | NEW |