Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3255 } else { | 3255 } else { |
| 3256 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden | 3256 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden |
| 3257 // the element in some way. In this case we just kill the drag. | 3257 // the element in some way. In this case we just kill the drag. |
| 3258 return false; | 3258 return false; |
| 3259 } | 3259 } |
| 3260 } | 3260 } |
| 3261 | 3261 |
| 3262 DragController& dragController = m_frame->page()->dragController(); | 3262 DragController& dragController = m_frame->page()->dragController(); |
| 3263 if (!dragController.populateDragDataTransfer(m_frame, dragState(), m_mouseDo wnPos)) | 3263 if (!dragController.populateDragDataTransfer(m_frame, dragState(), m_mouseDo wnPos)) |
| 3264 return false; | 3264 return false; |
| 3265 | |
| 3266 // If dispatching dragstart brings about a mouse down from deep within its | |
|
dcheng
2014/08/20 11:16:07
I might reword this to include the specific circum
| |
| 3267 // event handler somehow, the drag operation should also be cancelled. Do | |
| 3268 // that by checking if m_dragSrc is still set. | |
| 3265 m_mouseDownMayStartDrag = dispatchDragSrcEvent(EventTypeNames::dragstart, m_ mouseDown) | 3269 m_mouseDownMayStartDrag = dispatchDragSrcEvent(EventTypeNames::dragstart, m_ mouseDown) |
| 3266 && !m_frame->selection().isInPasswordField(); | 3270 && !m_frame->selection().isInPasswordField() && dragState().m_dragSrc; |
| 3267 | 3271 |
| 3268 // Invalidate clipboard here against anymore pasteboard writing for security . The drag | 3272 // Invalidate clipboard here against anymore pasteboard writing for security . The drag |
| 3269 // image can still be changed as we drag, but not the pasteboard data. | 3273 // image can still be changed as we drag, but not the pasteboard data. |
| 3270 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferImageWritable); | 3274 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferImageWritable); |
| 3271 | 3275 |
| 3272 if (m_mouseDownMayStartDrag) { | 3276 if (m_mouseDownMayStartDrag) { |
| 3273 // Dispatching the event could cause Page to go away. Make sure it's sti ll valid before trying to use DragController. | 3277 // Dispatching the event could cause Page to go away. Make sure it's sti ll valid before trying to use DragController. |
| 3274 m_didStartDrag = m_frame->page() && dragController.startDrag(m_frame, dr agState(), event.event(), m_mouseDownPos); | 3278 m_didStartDrag = m_frame->page() && dragController.startDrag(m_frame, dr agState(), event.event(), m_mouseDownPos); |
| 3275 // FIXME: This seems pretty useless now. The gesture code uses this as a signal for | 3279 // FIXME: This seems pretty useless now. The gesture code uses this as a signal for |
| 3276 // whether or not the drag started, but perhaps it can simply use the re turn value from | 3280 // whether or not the drag started, but perhaps it can simply use the re turn value from |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3850 unsigned EventHandler::accessKeyModifiers() | 3854 unsigned EventHandler::accessKeyModifiers() |
| 3851 { | 3855 { |
| 3852 #if OS(MACOSX) | 3856 #if OS(MACOSX) |
| 3853 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3857 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3854 #else | 3858 #else |
| 3855 return PlatformEvent::AltKey; | 3859 return PlatformEvent::AltKey; |
| 3856 #endif | 3860 #endif |
| 3857 } | 3861 } |
| 3858 | 3862 |
| 3859 } // namespace blink | 3863 } // namespace blink |
| OLD | NEW |