Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: Rebased. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 void RenderViewHostImpl::RenderProcessExited(RenderProcessHost* host, 620 void RenderViewHostImpl::RenderProcessExited(RenderProcessHost* host,
621 base::TerminationStatus status, 621 base::TerminationStatus status,
622 int exit_code) { 622 int exit_code) {
623 if (!GetWidget()->renderer_initialized()) 623 if (!GetWidget()->renderer_initialized())
624 return; 624 return;
625 625
626 GetWidget()->RendererExited(status, exit_code); 626 GetWidget()->RendererExited(status, exit_code);
627 delegate_->RenderViewTerminated(this, status, exit_code); 627 delegate_->RenderViewTerminated(this, status, exit_code);
628 } 628 }
629 629
630 void RenderViewHostImpl::DragTargetDragEnter(
631 const DropData& drop_data,
632 const gfx::Point& client_pt,
633 const gfx::Point& screen_pt,
634 WebDragOperationsMask operations_allowed,
635 int key_modifiers) {
636 DragTargetDragEnterWithMetaData(DropDataToMetaData(drop_data), client_pt,
637 screen_pt, operations_allowed, key_modifiers);
638 }
639
640 void RenderViewHostImpl::DragTargetDragEnterWithMetaData(
641 const std::vector<DropData::Metadata>& metadata,
642 const gfx::Point& client_pt,
643 const gfx::Point& screen_pt,
644 WebDragOperationsMask operations_allowed,
645 int key_modifiers) {
646 Send(new DragMsg_TargetDragEnter(GetRoutingID(), metadata, client_pt,
647 screen_pt, operations_allowed,
648 key_modifiers));
649 }
650
651 void RenderViewHostImpl::DragTargetDragOver(
652 const gfx::Point& client_pt,
653 const gfx::Point& screen_pt,
654 WebDragOperationsMask operations_allowed,
655 int key_modifiers) {
656 Send(new DragMsg_TargetDragOver(GetRoutingID(), client_pt, screen_pt,
657 operations_allowed, key_modifiers));
658 }
659
660 void RenderViewHostImpl::DragTargetDragLeave() {
661 Send(new DragMsg_TargetDragLeave(GetRoutingID()));
662 }
663
664 void RenderViewHostImpl::DragTargetDrop(const DropData& drop_data,
665 const gfx::Point& client_pt,
666 const gfx::Point& screen_pt,
667 int key_modifiers) {
668 DropData drop_data_with_permissions(drop_data);
669 GrantFileAccessFromDropData(&drop_data_with_permissions);
670 Send(new DragMsg_TargetDrop(GetRoutingID(), drop_data_with_permissions,
671 client_pt, screen_pt, key_modifiers));
672 }
673
674 void RenderViewHostImpl::FilterDropData(DropData* drop_data) { 630 void RenderViewHostImpl::FilterDropData(DropData* drop_data) {
675 #if DCHECK_IS_ON() 631 #if DCHECK_IS_ON()
676 drop_data->view_id = GetRoutingID(); 632 drop_data->view_id = GetRoutingID();
677 #endif // DCHECK_IS_ON() 633 #endif // DCHECK_IS_ON()
678 634
679 GetProcess()->FilterURL(true, &drop_data->url); 635 GetProcess()->FilterURL(true, &drop_data->url);
680 if (drop_data->did_originate_from_renderer) { 636 if (drop_data->did_originate_from_renderer) {
681 drop_data->filenames.clear(); 637 drop_data->filenames.clear();
682 } 638 }
683 } 639 }
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 // Note: We are using the origin URL provided by the sender here. It may be 1213 // Note: We are using the origin URL provided by the sender here. It may be
1258 // different from the receiver's. 1214 // different from the receiver's.
1259 file_system_file.url = 1215 file_system_file.url =
1260 GURL(storage::GetIsolatedFileSystemRootURIString( 1216 GURL(storage::GetIsolatedFileSystemRootURIString(
1261 file_system_url.origin(), filesystem_id, std::string()) 1217 file_system_url.origin(), filesystem_id, std::string())
1262 .append(register_name)); 1218 .append(register_name));
1263 } 1219 }
1264 } 1220 }
1265 1221
1266 } // namespace content 1222 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698