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

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

Issue 1723763002: Add WebDragData to blink::WebView::dragtargetDrop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 if (!m_fileInputElementUnderMouse) 381 if (!m_fileInputElementUnderMouse)
382 m_page->dragCaretController().setCaretPosition(m_documentUnderMouse- >frame()->positionForPoint(point)); 382 m_page->dragCaretController().setCaretPosition(m_documentUnderMouse- >frame()->positionForPoint(point));
383 383
384 LocalFrame* innerFrame = element->document().frame(); 384 LocalFrame* innerFrame = element->document().frame();
385 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy; 385 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy;
386 dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse; 386 dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse;
387 dragSession.numberOfItemsToBeAccepted = 0; 387 dragSession.numberOfItemsToBeAccepted = 0;
388 388
389 Vector<String> paths; 389 const unsigned numberOfFiles = dragData->numberOfFiles();
390 dragData->asFilePaths(paths);
391 const unsigned numberOfFiles = paths.size();
392 if (m_fileInputElementUnderMouse) { 390 if (m_fileInputElementUnderMouse) {
393 if (m_fileInputElementUnderMouse->isDisabledFormControl()) 391 if (m_fileInputElementUnderMouse->isDisabledFormControl())
394 dragSession.numberOfItemsToBeAccepted = 0; 392 dragSession.numberOfItemsToBeAccepted = 0;
395 else if (m_fileInputElementUnderMouse->multiple()) 393 else if (m_fileInputElementUnderMouse->multiple())
396 dragSession.numberOfItemsToBeAccepted = numberOfFiles; 394 dragSession.numberOfItemsToBeAccepted = numberOfFiles;
397 else if (numberOfFiles == 1) 395 else if (numberOfFiles == 1)
398 dragSession.numberOfItemsToBeAccepted = 1; 396 dragSession.numberOfItemsToBeAccepted = 1;
399 else 397 else
400 dragSession.numberOfItemsToBeAccepted = 0; 398 dragSession.numberOfItemsToBeAccepted = 0;
401 399
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 978
981 DEFINE_TRACE(DragController) 979 DEFINE_TRACE(DragController)
982 { 980 {
983 visitor->trace(m_page); 981 visitor->trace(m_page);
984 visitor->trace(m_documentUnderMouse); 982 visitor->trace(m_documentUnderMouse);
985 visitor->trace(m_dragInitiator); 983 visitor->trace(m_dragInitiator);
986 visitor->trace(m_fileInputElementUnderMouse); 984 visitor->trace(m_fileInputElementUnderMouse);
987 } 985 }
988 986
989 } // namespace blink 987 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698