Changeset 117327 in webkit
- Timestamp:
- May 16, 2012 1:04:36 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r117263 r117327 1 2012-05-16 Varun Jain <varunjain@google.com> 2 3 [chromium] No modifier flags (shift/ctrl/alt) in drag&drop events on chromium linux 4 https://bugs.webkit.org/show_bug.cgi?id=86236 5 6 Reviewed by Tony Chang. 7 8 * ManualTests/chromium/modifiers-during-drag-and-drop.html: Added. 9 1 10 2012-05-16 Keishi Hattori <keishi@webkit.org> 2 11 -
trunk/Source/WebCore/ChangeLog
r117326 r117327 1 2012-05-16 Varun Jain <varunjain@google.com> 2 3 [chromium] No modifier flags (shift/ctrl/alt) in drag&drop events on chromium linux 4 https://bugs.webkit.org/show_bug.cgi?id=86236 5 6 Reviewed by Tony Chang. 7 8 ManualTests: ManualTests/chromium/modifiers-during-drag-and-drop.html 9 10 * page/DragController.cpp: 11 (WebCore::createMouseEvent): 12 * platform/DragData.cpp: 13 (WebCore): 14 (WebCore::DragData::modifierKeyState): 15 * platform/DragData.h: 16 (DragData): 17 * platform/chromium/ChromiumDataObject.cpp: 18 (WebCore::ChromiumDataObject::ChromiumDataObject): 19 * platform/chromium/ChromiumDataObject.h: 20 (WebCore::ChromiumDataObject::modifierKeyState): 21 (WebCore::ChromiumDataObject::setModifierKeyState): 22 (ChromiumDataObject): 23 * platform/chromium/DragDataChromium.cpp: 24 (WebCore::DragData::modifierKeyState): 25 (WebCore): 26 1 27 2012-05-16 Jer Noble <jer.noble@apple.com> 2 28 -
trunk/Source/WebCore/page/DragController.cpp
r114551 r117327 78 78 bool shiftKey, ctrlKey, altKey, metaKey; 79 79 shiftKey = ctrlKey = altKey = metaKey = false; 80 PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); 80 int keyState = dragData->modifierKeyState(); 81 shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey); 82 ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey); 83 altKey = static_cast<bool>(keyState & PlatformEvent::AltKey); 84 metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey); 85 81 86 return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPosition(), 82 87 LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, -
trunk/Source/WebCore/platform/DragData.cpp
r75743 r117327 26 26 #include "config.h" 27 27 #include "DragData.h" 28 #include "PlatformEvent.h" 29 #include "PlatformKeyboardEvent.h" 28 30 29 31 #if ENABLE(DRAG_SUPPORT) … … 52 54 #endif 53 55 56 #if !PLATFORM(CHROMIUM) 57 int DragData::modifierKeyState() const 58 { 59 bool shiftKey, ctrlKey, altKey, metaKey; 60 shiftKey = ctrlKey = altKey = metaKey = false; 61 PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); 62 int keyState = 0; 63 if (shiftKey) 64 keyState = keyState | PlatformEvent::ShiftKey; 65 if (ctrlKey) 66 keyState = keyState | PlatformEvent::CtrlKey; 67 if (altKey) 68 keyState = keyState | PlatformEvent::AltKey; 69 if (metaKey) 70 keyState = keyState | PlatformEvent::MetaKey; 71 return keyState; 72 } 73 #endif 74 75 54 76 } // namespace WebCore 55 77 -
trunk/Source/WebCore/platform/DragData.h
r111113 r117327 119 119 bool containsFiles() const; 120 120 unsigned numberOfFiles() const; 121 int modifierKeyState() const; 121 122 #if PLATFORM(MAC) 122 123 const String& pasteboardName() { return m_pasteboardName; } -
trunk/Source/WebCore/platform/chromium/ChromiumDataObject.cpp
r116186 r117327 214 214 215 215 ChromiumDataObject::ChromiumDataObject() 216 : m_modifierKeyState(0) 216 217 { 217 218 } … … 220 221 : RefCounted<ChromiumDataObject>() 221 222 , m_itemList(other.m_itemList) 223 , m_modifierKeyState(0) 222 224 { 223 225 } -
trunk/Source/WebCore/platform/chromium/ChromiumDataObject.h
r116186 r117327 87 87 void addSharedBuffer(const String& name, PassRefPtr<SharedBuffer>); 88 88 89 int modifierKeyState() const { return m_modifierKeyState; } 90 void setModifierKeyState(int modifierKeyState) { m_modifierKeyState = modifierKeyState; } 91 89 92 private: 90 93 ChromiumDataObject(); … … 96 99 97 100 Vector<RefPtr<ChromiumDataObjectItem> > m_itemList; 101 102 // State of Shift/Ctrl/Alt/Meta keys. 103 int m_modifierKeyState; 98 104 }; 99 105 -
trunk/Source/WebCore/platform/chromium/DragDataChromium.cpp
r111061 r117327 74 74 { 75 75 return m_platformDragData->filenames().size(); 76 } 77 78 int DragData::modifierKeyState() const 79 { 80 return m_platformDragData->modifierKeyState(); 76 81 } 77 82 -
trunk/Source/WebKit/chromium/ChangeLog
r117290 r117327 1 2012-05-16 Varun Jain <varunjain@google.com> 2 3 [chromium] No modifier flags (shift/ctrl/alt) in drag&drop events on chromium linux 4 https://bugs.webkit.org/show_bug.cgi?id=86236 5 6 Reviewed by Tony Chang. 7 8 * public/WebView.h: 9 (WebView): 10 * src/WebViewImpl.cpp: 11 (WebKit::webInputEventKeyStateToPlatformEventKeyState): 12 (WebKit): 13 (WebKit::WebViewImpl::dragTargetDragEnter): 14 (WebKit::WebViewImpl::dragTargetDragOver): 15 (WebKit::WebViewImpl::dragTargetDrop): 16 (WebKit::WebViewImpl::dragTargetDragEnterOrOver): 17 * src/WebViewImpl.h: 18 (WebViewImpl): 19 1 20 2012-05-16 Yury Semikhatsky <yurys@chromium.org> 2 21 -
trunk/Source/WebKit/chromium/public/WebView.h
r117029 r117327 306 306 // Callback methods when a drag-and-drop operation is trying to drop 307 307 // something on the WebView. 308 // FIXME: Remove this method after chromium changes catch up. 308 309 virtual WebDragOperation dragTargetDragEnter( 309 310 const WebDragData&, 310 311 const WebPoint& clientPoint, const WebPoint& screenPoint, 311 312 WebDragOperationsMask operationsAllowed) = 0; 313 virtual WebDragOperation dragTargetDragEnter( 314 const WebDragData&, 315 const WebPoint& clientPoint, const WebPoint& screenPoint, 316 WebDragOperationsMask operationsAllowed, 317 int keyModifiers) = 0; 318 // FIXME: Remove this method after chromium changes catch up. 312 319 virtual WebDragOperation dragTargetDragOver( 313 320 const WebPoint& clientPoint, const WebPoint& screenPoint, 314 321 WebDragOperationsMask operationsAllowed) = 0; 322 virtual WebDragOperation dragTargetDragOver( 323 const WebPoint& clientPoint, const WebPoint& screenPoint, 324 WebDragOperationsMask operationsAllowed, 325 int keyModifiers) = 0; 315 326 virtual void dragTargetDragLeave() = 0; 327 // FIXME: Remove this method after chromium changes catch up. 316 328 virtual void dragTargetDrop( 317 329 const WebPoint& clientPoint, const WebPoint& screenPoint) = 0; 330 virtual void dragTargetDrop( 331 const WebPoint& clientPoint, const WebPoint& screenPoint, 332 int keyModifiers) = 0; 318 333 319 334 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r117190 r117327 240 240 static bool shouldUseExternalPopupMenus = false; 241 241 242 static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyState) 243 { 244 int platformEventKeyState = 0; 245 if (webInputEventKeyState & WebInputEvent::ShiftKey) 246 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::ShiftKey; 247 if (webInputEventKeyState & WebInputEvent::ControlKey) 248 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::CtrlKey; 249 if (webInputEventKeyState & WebInputEvent::AltKey) 250 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::AltKey; 251 if (webInputEventKeyState & WebInputEvent::MetaKey) 252 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::MetaKey; 253 return platformEventKeyState; 254 } 255 242 256 // WebView ---------------------------------------------------------------- 243 257 … … 2594 2608 WebDragOperationsMask operationsAllowed) 2595 2609 { 2610 return dragTargetDragEnter(webDragData, clientPoint, screenPoint, operationsAllowed, 0); 2611 } 2612 2613 WebDragOperation WebViewImpl::dragTargetDragEnter( 2614 const WebDragData& webDragData, 2615 const WebPoint& clientPoint, 2616 const WebPoint& screenPoint, 2617 WebDragOperationsMask operationsAllowed, 2618 int keyModifiers) 2619 { 2596 2620 ASSERT(!m_currentDragData); 2597 2621 … … 2599 2623 m_operationsAllowed = operationsAllowed; 2600 2624 2601 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter );2625 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter, keyModifiers); 2602 2626 } 2603 2627 … … 2607 2631 WebDragOperationsMask operationsAllowed) 2608 2632 { 2633 return dragTargetDragOver(clientPoint, screenPoint, operationsAllowed, 0); 2634 } 2635 2636 WebDragOperation WebViewImpl::dragTargetDragOver( 2637 const WebPoint& clientPoint, 2638 const WebPoint& screenPoint, 2639 WebDragOperationsMask operationsAllowed, 2640 int keyModifiers) 2641 { 2609 2642 m_operationsAllowed = operationsAllowed; 2610 2643 2611 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver );2644 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver, keyModifiers); 2612 2645 } 2613 2646 … … 2632 2665 void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, 2633 2666 const WebPoint& screenPoint) 2667 { 2668 dragTargetDrop(clientPoint, screenPoint, 0); 2669 } 2670 2671 void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, 2672 const WebPoint& screenPoint, 2673 int keyModifiers) 2634 2674 { 2635 2675 ASSERT(m_currentDragData); … … 2647 2687 } 2648 2688 2689 m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventKeyState(keyModifiers)); 2649 2690 DragData dragData( 2650 2691 m_currentDragData.get(), … … 2661 2702 } 2662 2703 2663 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction )2704 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) 2664 2705 { 2665 2706 ASSERT(m_currentDragData); 2666 2707 2708 m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventKeyState(keyModifiers)); 2667 2709 DragData dragData( 2668 2710 m_currentDragData.get(), -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r117107 r117327 232 232 const WebPoint& screenPoint, 233 233 WebDragOperationsMask operationsAllowed); 234 virtual WebDragOperation dragTargetDragEnter( 235 const WebDragData&, 236 const WebPoint& clientPoint, 237 const WebPoint& screenPoint, 238 WebDragOperationsMask operationsAllowed, 239 int keyModifiers); 234 240 virtual WebDragOperation dragTargetDragOver( 235 241 const WebPoint& clientPoint, 236 242 const WebPoint& screenPoint, 237 243 WebDragOperationsMask operationsAllowed); 244 virtual WebDragOperation dragTargetDragOver( 245 const WebPoint& clientPoint, 246 const WebPoint& screenPoint, 247 WebDragOperationsMask operationsAllowed, 248 int keyModifiers); 238 249 virtual void dragTargetDragLeave(); 239 250 virtual void dragTargetDrop( 240 251 const WebPoint& clientPoint, 241 252 const WebPoint& screenPoint); 253 virtual void dragTargetDrop( 254 const WebPoint& clientPoint, 255 const WebPoint& screenPoint, 256 int keyModifiers); 242 257 virtual unsigned long createUniqueIdentifierForRequest(); 243 258 virtual void inspectElementAt(const WebPoint& point); … … 579 594 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint, 580 595 const WebPoint& screenPoint, 581 DragAction); 596 DragAction, 597 int keyModifiers); 582 598 583 599 void configureAutoResizeMode();
Note: See TracChangeset
for help on using the changeset viewer.