| OLD | NEW |
| 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 Loading... |
| 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 | 979 |
| 982 DEFINE_TRACE(DragController) | 980 DEFINE_TRACE(DragController) |
| 983 { | 981 { |
| 984 visitor->trace(m_page); | 982 visitor->trace(m_page); |
| 985 visitor->trace(m_documentUnderMouse); | 983 visitor->trace(m_documentUnderMouse); |
| 986 visitor->trace(m_dragInitiator); | 984 visitor->trace(m_dragInitiator); |
| 987 visitor->trace(m_fileInputElementUnderMouse); | 985 visitor->trace(m_fileInputElementUnderMouse); |
| 988 } | 986 } |
| 989 | 987 |
| 990 } // namespace blink | 988 } // namespace blink |
| OLD | NEW |