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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); | 697 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); |
698 Send(new DragMsg_TargetDragOver(GetRoutingID(), client_pt_in_viewport, | 698 Send(new DragMsg_TargetDragOver(GetRoutingID(), client_pt_in_viewport, |
699 screen_pt, operations_allowed, | 699 screen_pt, operations_allowed, |
700 key_modifiers)); | 700 key_modifiers)); |
701 } | 701 } |
702 | 702 |
703 void RenderViewHostImpl::DragTargetDragLeave() { | 703 void RenderViewHostImpl::DragTargetDragLeave() { |
704 Send(new DragMsg_TargetDragLeave(GetRoutingID())); | 704 Send(new DragMsg_TargetDragLeave(GetRoutingID())); |
705 } | 705 } |
706 | 706 |
707 void RenderViewHostImpl::DragTargetDrop( | 707 void RenderViewHostImpl::DragTargetDrop(const DropData& drop_data, |
708 const gfx::Point& client_pt, | 708 bool is_drop_data_valid, |
709 const gfx::Point& screen_pt, | 709 const gfx::Point& client_pt, |
710 int key_modifiers) { | 710 const gfx::Point& screen_pt, |
| 711 int key_modifiers) { |
711 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); | 712 const gfx::Point client_pt_in_viewport = ConvertDIPToViewport(client_pt); |
712 Send(new DragMsg_TargetDrop(GetRoutingID(), client_pt_in_viewport, screen_pt, | 713 // TODO(hush): filter the drop_data if is_drop_data_valid == true. |
713 key_modifiers)); | 714 Send(new DragMsg_TargetDrop(GetRoutingID(), drop_data, is_drop_data_valid, |
| 715 client_pt_in_viewport, screen_pt, key_modifiers)); |
714 } | 716 } |
715 | 717 |
716 void RenderViewHostImpl::DragSourceEndedAt( | 718 void RenderViewHostImpl::DragSourceEndedAt( |
717 int client_x, int client_y, int screen_x, int screen_y, | 719 int client_x, int client_y, int screen_x, int screen_y, |
718 WebDragOperation operation) { | 720 WebDragOperation operation) { |
719 const gfx::Point client_pt_in_viewport = | 721 const gfx::Point client_pt_in_viewport = |
720 ConvertDIPToViewport(gfx::Point(client_x, client_y)); | 722 ConvertDIPToViewport(gfx::Point(client_x, client_y)); |
721 Send(new DragMsg_SourceEnded(GetRoutingID(), client_pt_in_viewport, | 723 Send(new DragMsg_SourceEnded(GetRoutingID(), client_pt_in_viewport, |
722 gfx::Point(screen_x, screen_y), operation)); | 724 gfx::Point(screen_x, screen_y), operation)); |
723 } | 725 } |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 | 1372 |
1371 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { | 1373 gfx::Point RenderViewHostImpl::ConvertDIPToViewport(const gfx::Point& point) { |
1372 // The point in guest view is already converted. | 1374 // The point in guest view is already converted. |
1373 if (!render_widget_host_->scale_input_to_viewport()) | 1375 if (!render_widget_host_->scale_input_to_viewport()) |
1374 return point; | 1376 return point; |
1375 float scale = GetWidget()->GetView()->current_device_scale_factor(); | 1377 float scale = GetWidget()->GetView()->current_device_scale_factor(); |
1376 return gfx::Point(point.x() * scale, point.y() * scale); | 1378 return gfx::Point(point.x() * scale, point.y() * scale); |
1377 } | 1379 } |
1378 | 1380 |
1379 } // namespace content | 1381 } // namespace content |
OLD | NEW |