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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 if (!m_fileInputElementUnderMouse) | 384 if (!m_fileInputElementUnderMouse) |
385 m_page->dragCaretController().setCaretPosition(m_documentUnderMouse-
>frame()->positionForPoint(point)); | 385 m_page->dragCaretController().setCaretPosition(m_documentUnderMouse-
>frame()->positionForPoint(point)); |
386 | 386 |
387 LocalFrame* innerFrame = element->document().frame(); | 387 LocalFrame* innerFrame = element->document().frame(); |
388 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ?
DragOperationMove : DragOperationCopy; | 388 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ?
DragOperationMove : DragOperationCopy; |
389 dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse; | 389 dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse; |
390 dragSession.numberOfItemsToBeAccepted = 0; | 390 dragSession.numberOfItemsToBeAccepted = 0; |
391 | 391 |
392 Vector<String> paths; | 392 const unsigned numberOfFiles = dragData->numberOfFiles(); |
393 dragData->asFilePaths(paths); | |
394 const unsigned numberOfFiles = paths.size(); | |
395 if (m_fileInputElementUnderMouse) { | 393 if (m_fileInputElementUnderMouse) { |
396 if (m_fileInputElementUnderMouse->isDisabledFormControl()) | 394 if (m_fileInputElementUnderMouse->isDisabledFormControl()) |
397 dragSession.numberOfItemsToBeAccepted = 0; | 395 dragSession.numberOfItemsToBeAccepted = 0; |
398 else if (m_fileInputElementUnderMouse->multiple()) | 396 else if (m_fileInputElementUnderMouse->multiple()) |
399 dragSession.numberOfItemsToBeAccepted = numberOfFiles; | 397 dragSession.numberOfItemsToBeAccepted = numberOfFiles; |
400 else if (numberOfFiles == 1) | 398 else if (numberOfFiles == 1) |
401 dragSession.numberOfItemsToBeAccepted = 1; | 399 dragSession.numberOfItemsToBeAccepted = 1; |
402 else | 400 else |
403 dragSession.numberOfItemsToBeAccepted = 0; | 401 dragSession.numberOfItemsToBeAccepted = 0; |
404 | 402 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 | 990 |
993 DEFINE_TRACE(DragController) | 991 DEFINE_TRACE(DragController) |
994 { | 992 { |
995 visitor->trace(m_page); | 993 visitor->trace(m_page); |
996 visitor->trace(m_documentUnderMouse); | 994 visitor->trace(m_documentUnderMouse); |
997 visitor->trace(m_dragInitiator); | 995 visitor->trace(m_dragInitiator); |
998 visitor->trace(m_fileInputElementUnderMouse); | 996 visitor->trace(m_fileInputElementUnderMouse); |
999 } | 997 } |
1000 | 998 |
1001 } // namespace blink | 999 } // namespace blink |
OLD | NEW |