| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 #endif // DCHECK_IS_ON() | 119 #endif // DCHECK_IS_ON() |
| 120 | 120 |
| 121 static WebMouseEvent createMouseEvent(DragData* dragData) { | 121 static WebMouseEvent createMouseEvent(DragData* dragData) { |
| 122 WebMouseEvent result( | 122 WebMouseEvent result( |
| 123 WebInputEvent::MouseMove, WebFloatPoint(dragData->clientPosition().x(), | 123 WebInputEvent::MouseMove, WebFloatPoint(dragData->clientPosition().x(), |
| 124 dragData->clientPosition().y()), | 124 dragData->clientPosition().y()), |
| 125 WebFloatPoint(dragData->globalPosition().x(), | 125 WebFloatPoint(dragData->globalPosition().x(), |
| 126 dragData->globalPosition().y()), | 126 dragData->globalPosition().y()), |
| 127 WebPointerProperties::Button::Left, 0, | 127 WebPointerProperties::Button::Left, 0, |
| 128 static_cast<PlatformEvent::Modifiers>(dragData->modifiers()), | 128 static_cast<WebInputEvent::Modifiers>(dragData->modifiers()), |
| 129 TimeTicks::Now().InSeconds()); | 129 TimeTicks::Now().InSeconds()); |
| 130 // TODO(dtapuska): Really we should chnage DragData to store the viewport | 130 // TODO(dtapuska): Really we should chnage DragData to store the viewport |
| 131 // coordinates and scale. | 131 // coordinates and scale. |
| 132 result.setFrameScale(1); | 132 result.setFrameScale(1); |
| 133 return result; | 133 return result; |
| 134 } | 134 } |
| 135 | 135 |
| 136 static DataTransfer* createDraggingDataTransfer(DataTransferAccessPolicy policy, | 136 static DataTransfer* createDraggingDataTransfer(DataTransferAccessPolicy policy, |
| 137 DragData* dragData) { | 137 DragData* dragData) { |
| 138 return DataTransfer::create(DataTransfer::DragAndDrop, policy, | 138 return DataTransfer::create(DataTransfer::DragAndDrop, policy, |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 // operationForDrag can be pulled into WebCore itself | 1216 // operationForDrag can be pulled into WebCore itself |
| 1217 DCHECK(dragData); | 1217 DCHECK(dragData); |
| 1218 return dragData->containsURL() && !m_didInitiateDrag ? DragOperationCopy | 1218 return dragData->containsURL() && !m_didInitiateDrag ? DragOperationCopy |
| 1219 : DragOperationNone; | 1219 : DragOperationNone; |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 bool DragController::isCopyKeyDown(DragData* dragData) { | 1222 bool DragController::isCopyKeyDown(DragData* dragData) { |
| 1223 int modifiers = dragData->modifiers(); | 1223 int modifiers = dragData->modifiers(); |
| 1224 | 1224 |
| 1225 #if OS(MACOSX) | 1225 #if OS(MACOSX) |
| 1226 return modifiers & PlatformEvent::AltKey; | 1226 return modifiers & WebInputEvent::AltKey; |
| 1227 #else | 1227 #else |
| 1228 return modifiers & PlatformEvent::CtrlKey; | 1228 return modifiers & WebInputEvent::ControlKey; |
| 1229 #endif | 1229 #endif |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 DragState& DragController::dragState() { | 1232 DragState& DragController::dragState() { |
| 1233 if (!m_dragState) | 1233 if (!m_dragState) |
| 1234 m_dragState = new DragState; | 1234 m_dragState = new DragState; |
| 1235 return *m_dragState; | 1235 return *m_dragState; |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 DEFINE_TRACE(DragController) { | 1238 DEFINE_TRACE(DragController) { |
| 1239 visitor->trace(m_page); | 1239 visitor->trace(m_page); |
| 1240 visitor->trace(m_documentUnderMouse); | 1240 visitor->trace(m_documentUnderMouse); |
| 1241 visitor->trace(m_dragInitiator); | 1241 visitor->trace(m_dragInitiator); |
| 1242 visitor->trace(m_dragState); | 1242 visitor->trace(m_dragState); |
| 1243 visitor->trace(m_fileInputElementUnderMouse); | 1243 visitor->trace(m_fileInputElementUnderMouse); |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 } // namespace blink | 1246 } // namespace blink |
| OLD | NEW |