Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: Source/core/page/DragController.cpp

Issue 879333002: Support buttons attribute for drag event (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/clipboard/DataObject.cpp ('k') | Source/core/page/DragData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DragController.cpp
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp
index 8c2c961841c10f3eb57ca76ac5b33b19e6511607..f364d3a00e08cbbd89fdd35d3504aefaa8224021 100644
--- a/Source/core/page/DragController.cpp
+++ b/Source/core/page/DragController.cpp
@@ -111,15 +111,10 @@ static bool dragTypeIsValid(DragSourceAction action)
static PlatformMouseEvent createMouseEvent(DragData* dragData)
{
- int keyState = dragData->modifierKeyState();
- bool shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey);
- bool ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey);
- bool altKey = static_cast<bool>(keyState & PlatformEvent::AltKey);
- bool metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey);
-
return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPosition(),
- LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
- metaKey, PlatformMouseEvent::RealOrIndistinguishable, currentTime());
+ LeftButton, PlatformEvent::MouseMoved, 0,
+ static_cast<PlatformEvent::Modifiers>(dragData->modifiers()),
+ PlatformMouseEvent::RealOrIndistinguishable, currentTime());
}
static PassRefPtrWillBeRawPtr<DataTransfer> createDraggingDataTransfer(DataTransferAccessPolicy policy, DragData* dragData)
@@ -955,12 +950,12 @@ DragOperation DragController::dragOperation(DragData* dragData)
bool DragController::isCopyKeyDown(DragData* dragData)
{
- int keyState = dragData->modifierKeyState();
+ int modifiers = dragData->modifiers();
#if OS(MACOSX)
- return keyState & PlatformEvent::AltKey;
+ return modifiers & PlatformEvent::AltKey;
#else
- return keyState & PlatformEvent::CtrlKey;
+ return modifiers & PlatformEvent::CtrlKey;
#endif
}
« no previous file with comments | « Source/core/clipboard/DataObject.cpp ('k') | Source/core/page/DragData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698