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

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

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). 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_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 void RenderWidgetHostImpl::DragTargetDrop(const DropData& drop_data, 1371 void RenderWidgetHostImpl::DragTargetDrop(const DropData& drop_data,
1372 const gfx::Point& client_pt, 1372 const gfx::Point& client_pt,
1373 const gfx::Point& screen_pt, 1373 const gfx::Point& screen_pt,
1374 int key_modifiers) { 1374 int key_modifiers) {
1375 DropData drop_data_with_permissions(drop_data); 1375 DropData drop_data_with_permissions(drop_data);
1376 GrantFileAccessFromDropData(&drop_data_with_permissions); 1376 GrantFileAccessFromDropData(&drop_data_with_permissions);
1377 Send(new DragMsg_TargetDrop(GetRoutingID(), drop_data_with_permissions, 1377 Send(new DragMsg_TargetDrop(GetRoutingID(), drop_data_with_permissions,
1378 client_pt, screen_pt, key_modifiers)); 1378 client_pt, screen_pt, key_modifiers));
1379 } 1379 }
1380 1380
1381 void RenderWidgetHostImpl::DragSourceEndedAt(
1382 int client_x, int client_y, int screen_x, int screen_y,
1383 blink::WebDragOperation operation) {
1384 Send(new DragMsg_SourceEnded(GetRoutingID(),
1385 gfx::Point(client_x, client_y),
1386 gfx::Point(screen_x, screen_y),
1387 operation));
1388 }
1389
1390 void RenderWidgetHostImpl::DragSourceSystemDragEnded() {
1391 Send(new DragMsg_SourceSystemDragEnded(GetRoutingID()));
1392 }
1393
1381 void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { 1394 void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
1382 #if DCHECK_IS_ON() 1395 #if DCHECK_IS_ON()
1383 drop_data->view_id = GetRoutingID(); 1396 drop_data->view_id = GetRoutingID();
1384 #endif // DCHECK_IS_ON() 1397 #endif // DCHECK_IS_ON()
1385 1398
1386 GetProcess()->FilterURL(true, &drop_data->url); 1399 GetProcess()->FilterURL(true, &drop_data->url);
1387 if (drop_data->did_originate_from_renderer) { 1400 if (drop_data->did_originate_from_renderer) {
1388 drop_data->filenames.clear(); 1401 drop_data->filenames.clear();
1389 } 1402 }
1390 } 1403 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 // TODO(paulmeyer): Stop relying on RenderViewHost once 1479 // TODO(paulmeyer): Stop relying on RenderViewHost once
1467 // DragSourceSystemDragEnded is moved into RenderWidgetHost. See 1480 // DragSourceSystemDragEnded is moved into RenderWidgetHost. See
1468 // crbug.com/647249. 1481 // crbug.com/647249.
1469 RenderViewHost* rvh = RenderViewHost::From(this); 1482 RenderViewHost* rvh = RenderViewHost::From(this);
1470 if (!rvh) 1483 if (!rvh)
1471 return; 1484 return;
1472 1485
1473 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); 1486 RenderViewHostDelegateView* view = delegate_->GetDelegateView();
1474 if (!view) { 1487 if (!view) {
1475 // Need to clear drag and drop state in blink. 1488 // Need to clear drag and drop state in blink.
1476 rvh->DragSourceSystemDragEnded(); 1489 DragSourceSystemDragEnded();
1477 return; 1490 return;
1478 } 1491 }
1479 1492
1480 DropData filtered_data(drop_data); 1493 DropData filtered_data(drop_data);
1481 RenderProcessHost* process = GetProcess(); 1494 RenderProcessHost* process = GetProcess();
1482 ChildProcessSecurityPolicyImpl* policy = 1495 ChildProcessSecurityPolicyImpl* policy =
1483 ChildProcessSecurityPolicyImpl::GetInstance(); 1496 ChildProcessSecurityPolicyImpl::GetInstance();
1484 1497
1485 // Allow drag of Javascript URLs to enable bookmarklet drag to bookmark bar. 1498 // Allow drag of Javascript URLs to enable bookmarklet drag to bookmark bar.
1486 if (!filtered_data.url.SchemeIs(url::kJavaScriptScheme)) 1499 if (!filtered_data.url.SchemeIs(url::kJavaScriptScheme))
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 // Note: We are using the origin URL provided by the sender here. It may be 2489 // Note: We are using the origin URL provided by the sender here. It may be
2477 // different from the receiver's. 2490 // different from the receiver's.
2478 file_system_file.url = 2491 file_system_file.url =
2479 GURL(storage::GetIsolatedFileSystemRootURIString( 2492 GURL(storage::GetIsolatedFileSystemRootURIString(
2480 file_system_url.origin(), filesystem_id, std::string()) 2493 file_system_url.origin(), filesystem_id, std::string())
2481 .append(register_name)); 2494 .append(register_name));
2482 } 2495 }
2483 } 2496 }
2484 2497
2485 } // namespace content 2498 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698