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

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2508013002: Drag-and-drop across OOPIFs. (Closed)
Patch Set: Some fixes for tests. 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 /* 1 /*
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 void DragController::cancelDrag() { 201 void DragController::cancelDrag() {
202 m_page->dragCaretController().clear(); 202 m_page->dragCaretController().clear();
203 } 203 }
204 204
205 void DragController::dragEnded() { 205 void DragController::dragEnded() {
206 m_dragInitiator = nullptr; 206 m_dragInitiator = nullptr;
207 m_didInitiateDrag = false; 207 m_didInitiateDrag = false;
208 m_page->dragCaretController().clear(); 208 m_page->dragCaretController().clear();
209 } 209 }
210 210
211 void DragController::dragExited(DragData* dragData) { 211 void DragController::dragExited(DragData* dragData, LocalFrame* localRoot) {
dcheng 2016/11/17 18:02:58 LocalFrame& here and elsewhere, since it's never n
paulmeyer 2016/11/17 20:22:25 Done.
212 DCHECK(dragData); 212 DCHECK(dragData);
213 LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame();
214 213
215 FrameView* frameView(mainFrame->view()); 214 FrameView* frameView(localRoot->view());
216 if (frameView) { 215 if (frameView) {
217 DataTransferAccessPolicy policy = 216 DataTransferAccessPolicy policy =
218 (!m_documentUnderMouse || 217 (!m_documentUnderMouse ||
219 m_documentUnderMouse->getSecurityOrigin()->isLocal()) 218 m_documentUnderMouse->getSecurityOrigin()->isLocal())
220 ? DataTransferReadable 219 ? DataTransferReadable
221 : DataTransferTypesReadable; 220 : DataTransferTypesReadable;
222 DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData); 221 DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData);
223 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask()); 222 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask());
224 mainFrame->eventHandler().cancelDragAndDrop(createMouseEvent(dragData), 223 localRoot->eventHandler().cancelDragAndDrop(createMouseEvent(dragData),
225 dataTransfer); 224 dataTransfer);
226 dataTransfer->setAccessPolicy( 225 dataTransfer->setAccessPolicy(
227 DataTransferNumb); // invalidate clipboard here for security 226 DataTransferNumb); // invalidate clipboard here for security
228 } 227 }
229 mouseMovedIntoDocument(nullptr); 228 mouseMovedIntoDocument(nullptr);
230 if (m_fileInputElementUnderMouse) 229 if (m_fileInputElementUnderMouse)
231 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); 230 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false);
232 m_fileInputElementUnderMouse = nullptr; 231 m_fileInputElementUnderMouse = nullptr;
233 } 232 }
234 233
235 bool DragController::performDrag(DragData* dragData) { 234 bool DragController::performDrag(DragData* dragData, LocalFrame* localRoot) {
236 DCHECK(dragData); 235 DCHECK(dragData);
237 m_documentUnderMouse = m_page->deprecatedLocalMainFrame()->documentAtPoint( 236 m_documentUnderMouse = localRoot->documentAtPoint(dragData->clientPosition());
238 dragData->clientPosition());
239 UserGestureIndicator gesture(DocumentUserGestureToken::create( 237 UserGestureIndicator gesture(DocumentUserGestureToken::create(
240 m_documentUnderMouse, UserGestureToken::NewGesture)); 238 m_documentUnderMouse, UserGestureToken::NewGesture));
241 if ((m_dragDestinationAction & DragDestinationActionDHTML) && 239 if ((m_dragDestinationAction & DragDestinationActionDHTML) &&
242 m_documentIsHandlingDrag) { 240 m_documentIsHandlingDrag) {
243 LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame();
244 bool preventedDefault = false; 241 bool preventedDefault = false;
245 if (mainFrame->view()) { 242 if (localRoot->view()) {
246 // Sending an event can result in the destruction of the view and part. 243 // Sending an event can result in the destruction of the view and part.
247 DataTransfer* dataTransfer = 244 DataTransfer* dataTransfer =
248 createDraggingDataTransfer(DataTransferReadable, dragData); 245 createDraggingDataTransfer(DataTransferReadable, dragData);
249 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask()); 246 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask());
250 EventHandler& eventHandler = mainFrame->eventHandler(); 247 EventHandler& eventHandler = localRoot->eventHandler();
251 preventedDefault = eventHandler.performDragAndDrop( 248 preventedDefault = eventHandler.performDragAndDrop(
252 createMouseEvent(dragData), dataTransfer) != 249 createMouseEvent(dragData), dataTransfer) !=
253 WebInputEventResult::NotHandled; 250 WebInputEventResult::NotHandled;
254 if (!preventedDefault) { 251 if (!preventedDefault) {
255 // When drop target is plugin element and it can process drag, we 252 // When drop target is plugin element and it can process drag, we
256 // should prevent default behavior. 253 // should prevent default behavior.
257 const IntPoint point = 254 const IntPoint point =
258 mainFrame->view()->rootFrameToContents(dragData->clientPosition()); 255 localRoot->view()->rootFrameToContents(dragData->clientPosition());
259 const HitTestResult result = eventHandler.hitTestResultAtPoint(point); 256 const HitTestResult result = eventHandler.hitTestResultAtPoint(point);
260 preventedDefault |= 257 preventedDefault |=
261 isHTMLPlugInElement(*result.innerNode()) && 258 isHTMLPlugInElement(*result.innerNode()) &&
262 toHTMLPlugInElement(result.innerNode())->canProcessDrag(); 259 toHTMLPlugInElement(result.innerNode())->canProcessDrag();
263 } 260 }
264 261
265 // Invalidate clipboard here for security. 262 // Invalidate clipboard here for security.
266 dataTransfer->setAccessPolicy(DataTransferNumb); 263 dataTransfer->setAccessPolicy(DataTransferNumb);
267 } 264 }
268 if (preventedDefault) { 265 if (preventedDefault) {
269 m_documentUnderMouse = nullptr; 266 m_documentUnderMouse = nullptr;
270 cancelDrag(); 267 cancelDrag();
271 return true; 268 return true;
272 } 269 }
273 } 270 }
274 271
275 if ((m_dragDestinationAction & DragDestinationActionEdit) && 272 if ((m_dragDestinationAction & DragDestinationActionEdit) &&
276 concludeEditDrag(dragData)) { 273 concludeEditDrag(dragData)) {
277 m_documentUnderMouse = nullptr; 274 m_documentUnderMouse = nullptr;
278 return true; 275 return true;
279 } 276 }
280 277
281 m_documentUnderMouse = nullptr; 278 m_documentUnderMouse = nullptr;
282 279
283 if (operationForLoad(dragData) == DragOperationNone) 280 if (operationForLoad(dragData, localRoot) == DragOperationNone)
284 return false; 281 return false;
285 282
286 if (m_page->settings().navigateOnDragDrop()) { 283 if (m_page->settings().navigateOnDragDrop()) {
287 m_page->mainFrame()->navigate( 284 m_page->mainFrame()->navigate(
288 FrameLoadRequest(nullptr, ResourceRequest(dragData->asURL()))); 285 FrameLoadRequest(nullptr, ResourceRequest(dragData->asURL())));
289 } 286 }
290 return true; 287 return true;
291 } 288 }
292 289
293 void DragController::mouseMovedIntoDocument(Document* newDocument) { 290 void DragController::mouseMovedIntoDocument(Document* newDocument) {
294 if (m_documentUnderMouse == newDocument) 291 if (m_documentUnderMouse == newDocument)
295 return; 292 return;
296 293
297 // If we were over another document clear the selection 294 // If we were over another document clear the selection
298 if (m_documentUnderMouse) 295 if (m_documentUnderMouse)
299 cancelDrag(); 296 cancelDrag();
300 m_documentUnderMouse = newDocument; 297 m_documentUnderMouse = newDocument;
301 } 298 }
302 299
303 DragSession DragController::dragEnteredOrUpdated(DragData* dragData) { 300 DragSession DragController::dragEnteredOrUpdated(DragData* dragData,
301 LocalFrame* localRoot) {
304 DCHECK(dragData); 302 DCHECK(dragData);
305 DCHECK(m_page->mainFrame()); 303
306 mouseMovedIntoDocument(m_page->deprecatedLocalMainFrame()->documentAtPoint( 304 mouseMovedIntoDocument(
307 dragData->clientPosition())); 305 localRoot->documentAtPoint(dragData->clientPosition()));
308 306
309 // TODO(esprehn): Replace acceptsLoadDrops with a Setting used in core. 307 // TODO(esprehn): Replace acceptsLoadDrops with a Setting used in core.
310 m_dragDestinationAction = 308 m_dragDestinationAction =
311 m_page->chromeClient().acceptsLoadDrops() 309 m_page->chromeClient().acceptsLoadDrops()
312 ? DragDestinationActionAny 310 ? DragDestinationActionAny
313 : static_cast<DragDestinationAction>(DragDestinationActionDHTML | 311 : static_cast<DragDestinationAction>(DragDestinationActionDHTML |
314 DragDestinationActionEdit); 312 DragDestinationActionEdit);
315 313
316 DragSession dragSession; 314 DragSession dragSession;
317 m_documentIsHandlingDrag = 315 m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction,
318 tryDocumentDrag(dragData, m_dragDestinationAction, dragSession); 316 dragSession, localRoot);
319 if (!m_documentIsHandlingDrag && 317 if (!m_documentIsHandlingDrag &&
320 (m_dragDestinationAction & DragDestinationActionLoad)) 318 (m_dragDestinationAction & DragDestinationActionLoad))
321 dragSession.operation = operationForLoad(dragData); 319 dragSession.operation = operationForLoad(dragData, localRoot);
322 return dragSession; 320 return dragSession;
323 } 321 }
324 322
325 static HTMLInputElement* asFileInput(Node* node) { 323 static HTMLInputElement* asFileInput(Node* node) {
326 DCHECK(node); 324 DCHECK(node);
327 for (; node; node = node->ownerShadowHost()) { 325 for (; node; node = node->ownerShadowHost()) {
328 if (isHTMLInputElement(*node) && 326 if (isHTMLInputElement(*node) &&
329 toHTMLInputElement(node)->type() == InputTypeNames::file) 327 toHTMLInputElement(node)->type() == InputTypeNames::file)
330 return toHTMLInputElement(node); 328 return toHTMLInputElement(node);
331 } 329 }
(...skipping 11 matching lines...) Expand all
343 while (n && !n->isElementNode()) 341 while (n && !n->isElementNode())
344 n = n->parentOrShadowHostNode(); 342 n = n->parentOrShadowHostNode();
345 if (n && n->isInShadowTree()) 343 if (n && n->isInShadowTree())
346 n = n->ownerShadowHost(); 344 n = n->ownerShadowHost();
347 345
348 return toElement(n); 346 return toElement(n);
349 } 347 }
350 348
351 bool DragController::tryDocumentDrag(DragData* dragData, 349 bool DragController::tryDocumentDrag(DragData* dragData,
352 DragDestinationAction actionMask, 350 DragDestinationAction actionMask,
353 DragSession& dragSession) { 351 DragSession& dragSession,
352 LocalFrame* localRoot) {
354 DCHECK(dragData); 353 DCHECK(dragData);
355 354
356 if (!m_documentUnderMouse) 355 if (!m_documentUnderMouse)
357 return false; 356 return false;
358 357
359 if (m_dragInitiator && 358 if (m_dragInitiator &&
360 !m_documentUnderMouse->getSecurityOrigin()->canAccess( 359 !m_documentUnderMouse->getSecurityOrigin()->canAccess(
361 m_dragInitiator->getSecurityOrigin())) 360 m_dragInitiator->getSecurityOrigin()))
362 return false; 361 return false;
363 362
364 bool isHandlingDrag = false; 363 bool isHandlingDrag = false;
365 if (actionMask & DragDestinationActionDHTML) { 364 if (actionMask & DragDestinationActionDHTML) {
366 isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation); 365 isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation, localRoot);
367 // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag. 366 // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag.
368 // tryDHTMLDrag fires dragenter event. The event listener that listens 367 // tryDHTMLDrag fires dragenter event. The event listener that listens
369 // to this event may create a nested message loop (open a modal dialog), 368 // to this event may create a nested message loop (open a modal dialog),
370 // which could process dragleave event and reset m_documentUnderMouse in 369 // which could process dragleave event and reset m_documentUnderMouse in
371 // dragExited. 370 // dragExited.
372 if (!m_documentUnderMouse) 371 if (!m_documentUnderMouse)
373 return false; 372 return false;
374 } 373 }
375 374
376 // It's unclear why this check is after tryDHTMLDrag. 375 // It's unclear why this check is after tryDHTMLDrag.
377 // We send drag events in tryDHTMLDrag and that may be the reason. 376 // We send drag events in tryDHTMLDrag and that may be the reason.
378 FrameView* frameView = m_documentUnderMouse->view(); 377 FrameView* frameView = m_documentUnderMouse->view();
379 if (!frameView) 378 if (!frameView)
380 return false; 379 return false;
381 380
382 if (isHandlingDrag) { 381 if (isHandlingDrag) {
383 m_page->dragCaretController().clear(); 382 m_page->dragCaretController().clear();
384 return true; 383 return true;
385 } 384 }
386 385
387 if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) { 386 if ((actionMask & DragDestinationActionEdit) &&
387 canProcessDrag(dragData, localRoot)) {
388 IntPoint point = frameView->rootFrameToContents(dragData->clientPosition()); 388 IntPoint point = frameView->rootFrameToContents(dragData->clientPosition());
389 Element* element = elementUnderMouse(m_documentUnderMouse.get(), point); 389 Element* element = elementUnderMouse(m_documentUnderMouse.get(), point);
390 if (!element) 390 if (!element)
391 return false; 391 return false;
392 392
393 HTMLInputElement* elementAsFileInput = asFileInput(element); 393 HTMLInputElement* elementAsFileInput = asFileInput(element);
394 if (m_fileInputElementUnderMouse != elementAsFileInput) { 394 if (m_fileInputElementUnderMouse != elementAsFileInput) {
395 if (m_fileInputElementUnderMouse) 395 if (m_fileInputElementUnderMouse)
396 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); 396 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false);
397 m_fileInputElementUnderMouse = elementAsFileInput; 397 m_fileInputElementUnderMouse = elementAsFileInput;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 // We are not over an editable region. Make sure we're clearing any prior drag 436 // We are not over an editable region. Make sure we're clearing any prior drag
437 // cursor. 437 // cursor.
438 m_page->dragCaretController().clear(); 438 m_page->dragCaretController().clear();
439 if (m_fileInputElementUnderMouse) 439 if (m_fileInputElementUnderMouse)
440 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); 440 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false);
441 m_fileInputElementUnderMouse = nullptr; 441 m_fileInputElementUnderMouse = nullptr;
442 return false; 442 return false;
443 } 443 }
444 444
445 DragOperation DragController::operationForLoad(DragData* dragData) { 445 DragOperation DragController::operationForLoad(DragData* dragData,
446 LocalFrame* localRoot) {
446 DCHECK(dragData); 447 DCHECK(dragData);
447 Document* doc = m_page->deprecatedLocalMainFrame()->documentAtPoint( 448 Document* doc = localRoot->documentAtPoint(dragData->clientPosition());
448 dragData->clientPosition());
449 449
450 if (doc && 450 if (doc &&
451 (m_didInitiateDrag || doc->isPluginDocument() || hasEditableStyle(*doc))) 451 (m_didInitiateDrag || doc->isPluginDocument() || hasEditableStyle(*doc)))
452 return DragOperationNone; 452 return DragOperationNone;
453 return dragOperation(dragData); 453 return dragOperation(dragData);
454 } 454 }
455 455
456 // Returns true if node at |point| is editable with populating |dragCaret| and 456 // Returns true if node at |point| is editable with populating |dragCaret| and
457 // |range|, otherwise returns false. 457 // |range|, otherwise returns false.
458 // TODO(yosin): We should return |VisibleSelection| rather than three values. 458 // TODO(yosin): We should return |VisibleSelection| rather than three values.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // fileInput should be the element we hit tested for, unless it was made 527 // fileInput should be the element we hit tested for, unless it was made
528 // display:none in a drop event handler. 528 // display:none in a drop event handler.
529 if (fileInput->layoutObject()) 529 if (fileInput->layoutObject())
530 DCHECK_EQ(fileInput, element); 530 DCHECK_EQ(fileInput, element);
531 if (fileInput->isDisabledFormControl()) 531 if (fileInput->isDisabledFormControl())
532 return false; 532 return false;
533 533
534 return fileInput->receiveDroppedFiles(dragData); 534 return fileInput->receiveDroppedFiles(dragData);
535 } 535 }
536 536
537 if (!m_page->dragController().canProcessDrag(dragData)) { 537 // TODO: Isn't |m_page->dragController()| the same as |this|?
538 if (!m_page->dragController().canProcessDrag(dragData,
539 innerFrame->localFrameRoot())) {
538 m_page->dragCaretController().clear(); 540 m_page->dragCaretController().clear();
539 return false; 541 return false;
540 } 542 }
541 543
542 if (m_page->dragCaretController().hasCaret()) { 544 if (m_page->dragCaretController().hasCaret()) {
543 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 545 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
544 // needs to be audited. See http://crbug.com/590369 for more details. 546 // needs to be audited. See http://crbug.com/590369 for more details.
545 m_page->dragCaretController() 547 m_page->dragCaretController()
546 .caretPosition() 548 .caretPosition()
547 .position() 549 .position()
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 if (rootEditableElement) { 650 if (rootEditableElement) {
649 if (LocalFrame* frame = rootEditableElement->document().frame()) { 651 if (LocalFrame* frame = rootEditableElement->document().frame()) {
650 frame->eventHandler().updateDragStateAfterEditDragIfNeeded( 652 frame->eventHandler().updateDragStateAfterEditDragIfNeeded(
651 rootEditableElement); 653 rootEditableElement);
652 } 654 }
653 } 655 }
654 656
655 return true; 657 return true;
656 } 658 }
657 659
658 bool DragController::canProcessDrag(DragData* dragData) { 660 bool DragController::canProcessDrag(DragData* dragData, LocalFrame* localRoot) {
659 DCHECK(dragData); 661 DCHECK(dragData);
660 662
661 if (!dragData->containsCompatibleContent()) 663 if (!dragData->containsCompatibleContent())
662 return false; 664 return false;
663 665
666 if (localRoot->contentLayoutItem().isNull())
667 return false;
dcheng 2016/11/17 18:02:58 Nit: newline after this.
paulmeyer 2016/11/17 20:22:25 Done.
664 IntPoint point = 668 IntPoint point =
665 m_page->deprecatedLocalMainFrame()->view()->rootFrameToContents( 669 localRoot->view()->rootFrameToContents(dragData->clientPosition());
666 dragData->clientPosition());
667 if (m_page->deprecatedLocalMainFrame()->contentLayoutItem().isNull())
668 return false;
669 670
670 HitTestResult result = 671 HitTestResult result = localRoot->eventHandler().hitTestResultAtPoint(point);
671 m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(
672 point);
673 672
674 if (!result.innerNode()) 673 if (!result.innerNode())
675 return false; 674 return false;
676 675
677 if (dragData->containsFiles() && asFileInput(result.innerNode())) 676 if (dragData->containsFiles() && asFileInput(result.innerNode()))
678 return true; 677 return true;
679 678
680 if (isHTMLPlugInElement(*result.innerNode())) { 679 if (isHTMLPlugInElement(*result.innerNode())) {
681 HTMLPlugInElement* plugin = toHTMLPlugInElement(result.innerNode()); 680 HTMLPlugInElement* plugin = toHTMLPlugInElement(result.innerNode());
682 if (!plugin->canProcessDrag() && !hasEditableStyle(*result.innerNode())) 681 if (!plugin->canProcessDrag() && !hasEditableStyle(*result.innerNode()))
(...skipping 22 matching lines...) Expand all
705 return DragOperationCopy; 704 return DragOperationCopy;
706 if (srcOpMask & DragOperationLink) 705 if (srcOpMask & DragOperationLink)
707 return DragOperationLink; 706 return DragOperationLink;
708 707
709 // FIXME: Does IE really return "generic" even if no operations were allowed 708 // FIXME: Does IE really return "generic" even if no operations were allowed
710 // by the source? 709 // by the source?
711 return DragOperationGeneric; 710 return DragOperationGeneric;
712 } 711 }
713 712
714 bool DragController::tryDHTMLDrag(DragData* dragData, 713 bool DragController::tryDHTMLDrag(DragData* dragData,
715 DragOperation& operation) { 714 DragOperation& operation,
715 LocalFrame* localRoot) {
716 DCHECK(dragData); 716 DCHECK(dragData);
717 DCHECK(m_documentUnderMouse); 717 DCHECK(m_documentUnderMouse);
718 LocalFrame* mainFrame = m_page->deprecatedLocalMainFrame(); 718 if (!localRoot->view())
719 if (!mainFrame->view())
720 return false; 719 return false;
721 720
722 DataTransferAccessPolicy policy = 721 DataTransferAccessPolicy policy =
723 m_documentUnderMouse->getSecurityOrigin()->isLocal() 722 m_documentUnderMouse->getSecurityOrigin()->isLocal()
724 ? DataTransferReadable 723 ? DataTransferReadable
725 : DataTransferTypesReadable; 724 : DataTransferTypesReadable;
726 DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData); 725 DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData);
727 DragOperation srcOpMask = dragData->draggingSourceOperationMask(); 726 DragOperation srcOpMask = dragData->draggingSourceOperationMask();
728 dataTransfer->setSourceOperation(srcOpMask); 727 dataTransfer->setSourceOperation(srcOpMask);
729 728
730 PlatformMouseEvent event = createMouseEvent(dragData); 729 PlatformMouseEvent event = createMouseEvent(dragData);
731 if (mainFrame->eventHandler().updateDragAndDrop(event, dataTransfer) == 730 if (localRoot->eventHandler().updateDragAndDrop(event, dataTransfer) ==
732 WebInputEventResult::NotHandled) { 731 WebInputEventResult::NotHandled) {
733 dataTransfer->setAccessPolicy( 732 dataTransfer->setAccessPolicy(
734 DataTransferNumb); // invalidate clipboard here for security 733 DataTransferNumb); // invalidate clipboard here for security
735 return false; 734 return false;
736 } 735 }
737 736
738 operation = dataTransfer->destinationOperation(); 737 operation = dataTransfer->destinationOperation();
739 if (dataTransfer->dropEffectIsUninitialized()) { 738 if (dataTransfer->dropEffectIsUninitialized()) {
740 operation = defaultOperationForDrag(srcOpMask); 739 operation = defaultOperationForDrag(srcOpMask);
741 } else if (!(srcOpMask & operation)) { 740 } else if (!(srcOpMask & operation)) {
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 } 1221 }
1223 1222
1224 DEFINE_TRACE(DragController) { 1223 DEFINE_TRACE(DragController) {
1225 visitor->trace(m_page); 1224 visitor->trace(m_page);
1226 visitor->trace(m_documentUnderMouse); 1225 visitor->trace(m_documentUnderMouse);
1227 visitor->trace(m_dragInitiator); 1226 visitor->trace(m_dragInitiator);
1228 visitor->trace(m_fileInputElementUnderMouse); 1227 visitor->trace(m_fileInputElementUnderMouse);
1229 } 1228 }
1230 1229
1231 } // namespace blink 1230 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698