Changeset 167074 in webkit
- Timestamp:
- Apr 10, 2014, 10:33:29 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167073 r167074 1 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 3 Eliminate DragSession structure 4 https://bugs.webkit.org/show_bug.cgi?id=131465 5 6 Reviewed by Benjamin Poulain. 7 8 DragSession is really just a transient response to NSDragDestination delegate methods. 9 The "session" name was quite misleading, and thankfully, we don't need a class for this 10 bag of data at all. 11 12 * WebCore.xcodeproj/project.pbxproj: 13 * page/DragController.cpp: 14 (WebCore::DragController::DragController): 15 (WebCore::DragController::dragEntered): 16 (WebCore::DragController::dragUpdated): 17 (WebCore::DragController::dragEnteredOrUpdated): 18 (WebCore::DragController::tryDocumentDrag): 19 * page/DragController.h: 20 (WebCore::DragController::mouseIsOverFileInput): 21 (WebCore::DragController::numberOfItemsToBeAccepted): 22 * page/DragSession.h: Removed. 23 1 24 2014-04-10 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 25 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r167025 r167074 1181 1181 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */; }; 1182 1182 31611E630E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */; }; 1183 3169379C14609C6C00C01362 /* DragSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 3169379A14609C5B00C01362 /* DragSession.h */; settings = {ATTRIBUTES = (Private, ); }; };1184 1183 316FE0710E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */; }; 1185 1184 316FE0720E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */; }; … … 8081 8080 31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitCSSTransformValue.mm; sourceTree = "<group>"; }; 8082 8081 31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSTransformValueInternal.h; sourceTree = "<group>"; }; 8083 3169379A14609C5B00C01362 /* DragSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragSession.h; sourceTree = "<group>"; };8084 8082 316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSKeyframeRule.cpp; sourceTree = "<group>"; }; 8085 8083 316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSKeyframeRule.h; sourceTree = "<group>"; }; … … 16274 16272 A7CA595C0B27BD9E00FA021D /* DragController.cpp */, 16275 16273 A7CA595B0B27BD9E00FA021D /* DragController.h */, 16276 3169379A14609C5B00C01362 /* DragSession.h */,16277 16274 81F65FF513788FAA00FF6F2D /* DragState.h */, 16278 16275 1AF326770D78B9440068F0C4 /* EditorClient.h */, … … 23754 23751 A7B6E69F0B291A9600D0529F /* DragData.h in Headers */, 23755 23752 A7CFB3D20B7ED10A0070C32D /* DragImage.h in Headers */, 23756 3169379C14609C6C00C01362 /* DragSession.h in Headers */,23757 23753 81F65FF613788FAA00FF6F2D /* DragState.h in Headers */, 23758 23754 498770DC1242C535002226BA /* DrawingBuffer.h in Headers */, -
trunk/Source/WebCore/page/DragController.cpp
r167040 r167074 38 38 #include "DragData.h" 39 39 #include "DragImage.h" 40 #include "DragSession.h"41 40 #include "DragState.h" 42 41 #include "Editor.h" … … 102 101 : m_page(page) 103 102 , m_client(client) 104 , m_documentUnderMouse(0) 105 , m_dragInitiator(0) 106 , m_fileInputElementUnderMouse(0) 103 , m_numberOfItemsToBeAccepted(0) 107 104 , m_documentIsHandlingDrag(false) 108 105 , m_dragDestinationAction(DragDestinationActionNone) … … 177 174 } 178 175 179 Drag Session DragController::dragEntered(DragData& dragData)176 DragOperation DragController::dragEntered(DragData& dragData) 180 177 { 181 178 return dragEnteredOrUpdated(dragData); … … 197 194 } 198 195 199 Drag Session DragController::dragUpdated(DragData& dragData)196 DragOperation DragController::dragUpdated(DragData& dragData) 200 197 { 201 198 return dragEnteredOrUpdated(dragData); … … 248 245 } 249 246 250 Drag Session DragController::dragEnteredOrUpdated(DragData& dragData)247 DragOperation DragController::dragEnteredOrUpdated(DragData& dragData) 251 248 { 252 249 mouseMovedIntoDocument(m_page.mainFrame().documentAtPoint(dragData.clientPosition())); … … 255 252 if (m_dragDestinationAction == DragDestinationActionNone) { 256 253 cancelDrag(); // FIXME: Why not call mouseMovedIntoDocument(0)? 257 return Drag Session();258 } 259 260 Drag Session dragSession;261 m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction, drag Session);254 return DragOperationNone; 255 } 256 257 DragOperation dragOperation = DragOperationNone; 258 m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction, dragOperation); 262 259 if (!m_documentIsHandlingDrag && (m_dragDestinationAction & DragDestinationActionLoad)) 263 drag Session.operation = operationForLoad(dragData);264 return drag Session;260 dragOperation = operationForLoad(dragData); 261 return dragOperation; 265 262 } 266 263 … … 298 295 } 299 296 300 bool DragController::tryDocumentDrag(DragData& dragData, DragDestinationAction actionMask, Drag Session& dragSession)297 bool DragController::tryDocumentDrag(DragData& dragData, DragDestinationAction actionMask, DragOperation& dragOperation) 301 298 { 302 299 if (!m_documentUnderMouse) … … 308 305 bool isHandlingDrag = false; 309 306 if (actionMask & DragDestinationActionDHTML) { 310 isHandlingDrag = tryDHTMLDrag(dragData, drag Session.operation);307 isHandlingDrag = tryDHTMLDrag(dragData, dragOperation); 311 308 // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag. 312 309 // tryDHTMLDrag fires dragenter event. The event listener that listens … … 331 328 if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) { 332 329 if (dragData.containsColor()) { 333 drag Session.operation = DragOperationGeneric;330 dragOperation = DragOperationGeneric; 334 331 return true; 335 332 } … … 351 348 352 349 Frame* innerFrame = element->document().frame(); 353 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy; 354 dragSession.mouseIsOverFileInput = m_fileInputElementUnderMouse; 355 dragSession.numberOfItemsToBeAccepted = 0; 350 dragOperation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy; 351 m_numberOfItemsToBeAccepted = 0; 356 352 357 353 unsigned numberOfFiles = dragData.numberOfFiles(); 358 354 if (m_fileInputElementUnderMouse) { 359 355 if (m_fileInputElementUnderMouse->isDisabledFormControl()) 360 dragSession.numberOfItemsToBeAccepted = 0;356 m_numberOfItemsToBeAccepted = 0; 361 357 else if (m_fileInputElementUnderMouse->multiple()) 362 dragSession.numberOfItemsToBeAccepted = numberOfFiles;358 m_numberOfItemsToBeAccepted = numberOfFiles; 363 359 else if (numberOfFiles > 1) 364 dragSession.numberOfItemsToBeAccepted = 0;360 m_numberOfItemsToBeAccepted = 0; 365 361 else 366 dragSession.numberOfItemsToBeAccepted = 1;362 m_numberOfItemsToBeAccepted = 1; 367 363 368 if (! dragSession.numberOfItemsToBeAccepted)369 drag Session.operation = DragOperationNone;370 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles( dragSession.numberOfItemsToBeAccepted);364 if (!m_numberOfItemsToBeAccepted) 365 dragOperation = DragOperationNone; 366 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(m_numberOfItemsToBeAccepted); 371 367 } else { 372 368 // We are not over a file input element. The dragged item(s) will only 373 369 // be loaded into the view the number of dragged items is 1. 374 dragSession.numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1;370 m_numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1; 375 371 } 376 372 -
trunk/Source/WebCore/page/DragController.h
r167040 r167074 46 46 class PlatformMouseEvent; 47 47 48 struct DragSession;49 48 struct DragState; 50 49 … … 59 58 DragClient& client() const { return m_client; } 60 59 61 Drag Session dragEntered(DragData&);60 DragOperation dragEntered(DragData&); 62 61 void dragExited(DragData&); 63 Drag Session dragUpdated(DragData&);62 DragOperation dragUpdated(DragData&); 64 63 bool performDragOperation(DragData&); 65 64 65 bool mouseIsOverFileInput() const { return m_fileInputElementUnderMouse; } 66 unsigned numberOfItemsToBeAccepted() const { return m_numberOfItemsToBeAccepted; } 67 66 68 // FIXME: It should be possible to remove a number of these accessors once all 67 69 // drag logic is in WebCore. … … 96 98 bool canProcessDrag(DragData&); 97 99 bool concludeEditDrag(DragData&); 98 Drag Session dragEnteredOrUpdated(DragData&);100 DragOperation dragEnteredOrUpdated(DragData&); 99 101 DragOperation operationForLoad(DragData&); 100 bool tryDocumentDrag(DragData&, DragDestinationAction, Drag Session&);102 bool tryDocumentDrag(DragData&, DragDestinationAction, DragOperation&); 101 103 bool tryDHTMLDrag(DragData&, DragOperation&); 102 104 DragOperation dragOperation(DragData&); … … 118 120 RefPtr<Document> m_dragInitiator; // The Document (if any) that initiated the drag. 119 121 RefPtr<HTMLInputElement> m_fileInputElementUnderMouse; 122 unsigned m_numberOfItemsToBeAccepted; 120 123 bool m_documentIsHandlingDrag; 121 124 -
trunk/Source/WebKit/mac/ChangeLog
r167040 r167074 1 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 3 Eliminate DragSession structure 4 https://bugs.webkit.org/show_bug.cgi?id=131465 5 6 Reviewed by Benjamin Poulain. 7 8 * WebView/WebView.mm: 9 (-[WebView draggingEntered:]): 10 (-[WebView draggingUpdated:]): 11 1 12 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 13 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r167040 r167074 124 124 #import <WebCore/DragController.h> 125 125 #import <WebCore/DragData.h> 126 #import <WebCore/DragSession.h>127 126 #import <WebCore/Editor.h> 128 127 #import <WebCore/EventHandler.h> … … 5981 5980 IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); 5982 5981 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 5983 return core(self)->dragController().dragEntered(dragData) .operation;5982 return core(self)->dragController().dragEntered(dragData); 5984 5983 } 5985 5984 … … 5993 5992 IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); 5994 5993 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 5995 return page->dragController().dragUpdated(dragData) .operation;5994 return page->dragController().dragUpdated(dragData); 5996 5995 } 5997 5996 -
trunk/Source/WebKit/win/ChangeLog
r167040 r167074 1 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 3 Eliminate DragSession structure 4 https://bugs.webkit.org/show_bug.cgi?id=131465 5 6 Reviewed by Benjamin Poulain. 7 8 * WebView.cpp: 9 (WebView::DragEnter): 10 (WebView::DragOver): 11 1 12 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 13 -
trunk/Source/WebKit/win/WebView.cpp
r167040 r167074 86 86 #include <WebCore/DragController.h> 87 87 #include <WebCore/DragData.h> 88 #include <WebCore/DragSession.h>89 88 #include <WebCore/Editor.h> 90 89 #include <WebCore/EventHandler.h> … … 5247 5246 DragData data(pDataObject, IntPoint(localpt.x, localpt.y), 5248 5247 IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 5249 *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragEntered(data) .operation);5248 *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragEntered(data)); 5250 5249 5251 5250 m_lastDropEffect = *pdwEffect; … … 5266 5265 DragData data(m_dragData.get(), IntPoint(localpt.x, localpt.y), 5267 5266 IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 5268 *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragUpdated(data) .operation);5267 *pdwEffect = dragOperationToDragCursor(m_page->dragController().dragUpdated(data)); 5269 5268 } else 5270 5269 *pdwEffect = DROPEFFECT_NONE; -
trunk/Source/WebKit2/ChangeLog
r167072 r167074 1 2014-04-09 Alexey Proskuryakov <ap@apple.com> 2 3 Eliminate DragSession structure 4 https://bugs.webkit.org/show_bug.cgi?id=131465 5 6 Reviewed by Benjamin Poulain. 7 8 * Scripts/webkit2/messages.py: 9 (struct_or_class): 10 * Shared/WebCoreArgumentCoders.cpp: 11 (IPC::ArgumentCoder<DragSession>::encode): Deleted. 12 (IPC::ArgumentCoder<DragSession>::decode): Deleted. 13 * Shared/WebCoreArgumentCoders.h: 14 * UIProcess/API/mac/WKView.mm: 15 (-[WKView draggingEntered:]): 16 (-[WKView draggingUpdated:]): 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::WebPageProxy): 19 (WebKit::WebPageProxy::didPerformDragControllerAction): 20 * UIProcess/WebPageProxy.h: 21 (WebKit::WebPageProxy::currentDragOperation): 22 (WebKit::WebPageProxy::currentDragIsOverFileInput): 23 (WebKit::WebPageProxy::currentDragNumberOfFilesToBeAccepted): 24 (WebKit::WebPageProxy::resetCurrentDragInformation): 25 (WebKit::WebPageProxy::dragSession): Deleted. 26 (WebKit::WebPageProxy::resetDragSession): Deleted. 27 * UIProcess/WebPageProxy.messages.in: 28 * WebProcess/WebPage/WebPage.cpp: 29 (WebKit::WebPage::performDragControllerAction): 30 1 31 2014-04-10 Martin Robinson <mrobinson@igalia.com> 2 32 -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r165823 r167074 173 173 'WebCore::CompositionUnderline', 174 174 'WebCore::Cookie', 175 'WebCore::DragSession',176 175 'WebCore::FloatPoint3D', 177 176 'WebCore::FileChooserSettings', -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r166741 r167074 36 36 #include <WebCore/DatabaseDetails.h> 37 37 #include <WebCore/DictationAlternative.h> 38 #include <WebCore/DragSession.h>39 38 #include <WebCore/Editor.h> 40 39 #include <WebCore/FileChooser.h> … … 1311 1310 } 1312 1311 1313 void ArgumentCoder<DragSession>::encode(ArgumentEncoder& encoder, const DragSession& result)1314 {1315 encoder.encodeEnum(result.operation);1316 encoder << result.mouseIsOverFileInput;1317 encoder << result.numberOfItemsToBeAccepted;1318 }1319 1320 bool ArgumentCoder<DragSession>::decode(ArgumentDecoder& decoder, DragSession& result)1321 {1322 if (!decoder.decodeEnum(result.operation))1323 return false;1324 if (!decoder.decode(result.mouseIsOverFileInput))1325 return false;1326 if (!decoder.decode(result.numberOfItemsToBeAccepted))1327 return false;1328 return true;1329 }1330 1331 1312 void ArgumentCoder<URL>::encode(ArgumentEncoder& encoder, const URL& result) 1332 1313 { -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r166542 r167074 68 68 struct Cookie; 69 69 struct DictationAlternative; 70 struct DragSession;71 70 struct FileChooserSettings; 72 71 struct IDBDatabaseMetadata; … … 340 339 }; 341 340 342 template<> struct ArgumentCoder<WebCore::DragSession> {343 static void encode(ArgumentEncoder&, const WebCore::DragSession&);344 static bool decode(ArgumentDecoder&, WebCore::DragSession&);345 };346 347 341 template<> struct ArgumentCoder<WebCore::URL> { 348 342 static void encode(ArgumentEncoder&, const WebCore::URL&); -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r167040 r167074 79 79 #import <WebCore/DragController.h> 80 80 #import <WebCore/DragData.h> 81 #import <WebCore/DragSession.h>82 81 #import <WebCore/FloatRect.h> 83 82 #import <WebCore/Image.h> … … 2238 2237 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 2239 2238 2240 _data->_page->reset DragSession();2239 _data->_page->resetCurrentDragInformation(); 2241 2240 _data->_page->dragEntered(dragData, [[draggingInfo draggingPasteboard] name]); 2242 2241 return NSDragOperationCopy; … … 2250 2249 _data->_page->dragUpdated(dragData, [[draggingInfo draggingPasteboard] name]); 2251 2250 2252 WebCore::DragSession dragSession = _data->_page->dragSession(); 2253 NSInteger numberOfValidItemsForDrop = dragSession.numberOfItemsToBeAccepted; 2251 NSInteger numberOfValidItemsForDrop = _data->_page->currentDragNumberOfFilesToBeAccepted(); 2254 2252 NSDraggingFormation draggingFormation = NSDraggingFormationNone; 2255 if ( dragSession.mouseIsOverFileInput&& numberOfValidItemsForDrop > 0)2253 if (_data->_page->currentDragIsOverFileInput() && numberOfValidItemsForDrop > 0) 2256 2254 draggingFormation = NSDraggingFormationList; 2257 2255 … … 2261 2259 [draggingInfo setDraggingFormation:draggingFormation]; 2262 2260 2263 return dragSession.operation;2261 return _data->_page->currentDragOperation(); 2264 2262 } 2265 2263 … … 2270 2268 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 2271 2269 _data->_page->dragExited(dragData, [[draggingInfo draggingPasteboard] name]); 2272 _data->_page->reset DragSession();2270 _data->_page->resetCurrentDragInformation(); 2273 2271 } 2274 2272 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r167040 r167074 90 90 #include <WebCore/DragController.h> 91 91 #include <WebCore/DragData.h> 92 #include <WebCore/DragSession.h>93 92 #include <WebCore/FloatRect.h> 94 93 #include <WebCore/FocusDirection.h> … … 321 320 , m_pendingLearnOrIgnoreWordMessageCount(0) 322 321 , m_mainFrameHasCustomContentProvider(false) 322 , m_currentDragOperation(DragOperationNone) 323 , m_currentDragIsOverFileInput(false) 324 , m_currentDragNumberOfFilesToBeAccepted(0) 323 325 , m_delegatesScrolling(false) 324 326 , m_mainFrameHasHorizontalScrollbar(false) … … 1206 1208 } 1207 1209 1208 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession) 1209 { 1210 m_currentDragSession = dragSession; 1210 void WebPageProxy::didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted) 1211 { 1212 MESSAGE_CHECK(dragOperation <= DragOperationDelete); 1213 1214 m_currentDragOperation = static_cast<DragOperation>(dragOperation); 1215 m_currentDragIsOverFileInput = mouseIsOverFileInput; 1216 m_currentDragNumberOfFilesToBeAccepted = numberOfItemsToBeAccepted; 1211 1217 } 1212 1218 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r167060 r167074 63 63 #include <WebCore/Color.h> 64 64 #include <WebCore/DragActions.h> 65 #include <WebCore/DragSession.h>66 65 #include <WebCore/HitTestResult.h> 67 66 #include <WebCore/Page.h> … … 83 82 #if ENABLE(DRAG_SUPPORT) 84 83 #include <WebCore/DragActions.h> 85 #include <WebCore/DragSession.h>86 84 #endif 87 85 … … 854 852 void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&); 855 853 856 void didPerformDragControllerAction( WebCore::DragSession);854 void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted); 857 855 void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation); 858 856 #if PLATFORM(COCOA) … … 904 902 905 903 #if ENABLE(DRAG_SUPPORT) 906 WebCore::DragSession dragSession() const { return m_currentDragSession; } 907 void resetDragSession() { m_currentDragSession = WebCore::DragSession(); } 904 WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; } 905 bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; } 906 unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; } 907 void resetCurrentDragInformation() 908 { 909 m_currentDragOperation = WebCore::DragOperationNone; 910 m_currentDragIsOverFileInput = false; 911 m_currentDragNumberOfFilesToBeAccepted = 0; 912 } 908 913 #endif 909 914 … … 1577 1582 1578 1583 #if ENABLE(DRAG_SUPPORT) 1579 WebCore::DragSession m_currentDragSession; 1584 // Current drag destination details are delivered as an asynchronous response, 1585 // so we preserve them to be used when the next dragging delegate call is made. 1586 WebCore::DragOperation m_currentDragOperation; 1587 bool m_currentDragIsOverFileInput; 1588 unsigned m_currentDragNumberOfFilesToBeAccepted; 1580 1589 #endif 1581 1590 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r167060 r167074 256 256 # Drag and drop messages 257 257 #if ENABLE(DRAG_SUPPORT) 258 DidPerformDragControllerAction( WebCore::DragSession dragSession)258 DidPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted) 259 259 #endif 260 260 #if PLATFORM(COCOA) && ENABLE(DRAG_SUPPORT) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r167040 r167074 101 101 #include <WebCore/DragController.h> 102 102 #include <WebCore/DragData.h> 103 #include <WebCore/DragSession.h>104 103 #include <WebCore/ElementIterator.h> 105 104 #include <WebCore/EventHandler.h> … … 2741 2740 { 2742 2741 if (!m_page) { 2743 send(Messages::WebPageProxy::DidPerformDragControllerAction( WebCore::DragSession()));2742 send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0)); 2744 2743 DataObjectGtk* data = const_cast<DataObjectGtk*>(dragData.platformData()); 2745 2744 data->deref(); … … 2777 2776 { 2778 2777 if (!m_page) { 2779 send(Messages::WebPageProxy::DidPerformDragControllerAction( WebCore::DragSession()));2778 send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0)); 2780 2779 return; 2781 2780 } … … 2783 2782 DragData dragData(dragStorageName, clientPosition, globalPosition, static_cast<DragOperation>(draggingSourceOperationMask), static_cast<DragApplicationFlags>(flags)); 2784 2783 switch (action) { 2785 case DragControllerActionEntered: 2786 send(Messages::WebPageProxy::DidPerformDragControllerAction(m_page->dragController().dragEntered(dragData))); 2784 case DragControllerActionEntered: { 2785 DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData); 2786 send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted())); 2787 2787 break; 2788 2788 2789 case DragControllerActionUpdated: 2790 send(Messages::WebPageProxy::DidPerformDragControllerAction(m_page->dragController().dragUpdated(dragData))); 2789 } 2790 case DragControllerActionUpdated: { 2791 DragOperation resolvedDragOperation = m_page->dragController().dragUpdated(dragData); 2792 send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted())); 2791 2793 break; 2792 2794 } 2793 2795 case DragControllerActionExited: 2794 2796 m_page->dragController().dragExited(dragData);
Note:
See TracChangeset
for help on using the changeset viewer.